Using AIGIC with Node.js
AGIN - JavaScript sdk for AIGIC A Node.js client for AIGIC. It lets you run models from your Node.js code, and everything else you can do with HTTP API.
[!IMPORTANT] This library can't interact with AGIN API directly from a browser.
- Node.js version: 16.20.0
- API version: 1.0.0
- Package version: 1.0.0
Installation
For Node.js
npm
Install it from npm:
npm install agin --save
Getting Started
Please follow the installation instruction and execute the following JS code:
const AGIN = require("agin");
const options = {
//get your api key or jwt token from https://console.aigic.ai
auth:"my api key or jwt token"
}
const agin = new AGIN(options);
let response = await agin.prediction("/predictions/ai/ssd-1b",
{
input:{
"seed": 36446545872,
"width": 768,
"height": 768,
"prompt": "with smoke, half ice and half fire and ultra realistic in detail.wolf, typography, dark fantasy, wildlife photography, vibrant, cinematic and on a black background",
"scheduler": "K_EULER",
"num_outputs": 1,
"guidance_scale": 9,
"negative_prompt": "scary, cartoon, painting",
"num_inference_steps": 25
}
});
console.log("test",response);
API
All URIs are default relative to https://api.aigic.ai
Constructor
const agin = new AGIN(options);
name | type | Description |
---|---|---|
host | string | The request host |
auth | string | Required.You can choose either API key or JWT token for authentication. |
Docs
For more information, please visit the site https://docs.aigic.ai