defaulttext2img
typeenum
value typestring
optionstext2img
{
"guidance_scale": 4,
"height": 1024,
"img_weight": 1,
"negative_prompt": "ugly, tiling, oversaturated, undersaturated, poorly drawn hands, poorly drawn feet, poorly drawn face, out of frame, extra limbs, disfigured, deformed, body out of frame, blurry, bad anatomy, blurred, watermark, grainy, signature, cut off, draft",
"num_inference_steps": 18,
"num_outputs": 1,
"num_steps_prior": 2,
"prompt": "A alien cheeseburger creature eating itself, claymation, cinematic, moody lighting",
"scheduler": "unipc",
"task": "text2img",
"width": 1024
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Bqq**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
import fs from "node:fs";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run adalab-ai/kandinsky_v2_2 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"adalab-ai/kandinsky_v2_2:eb68c00d7fc7d7297a04dcecbdd29032361ab8f1d3f6843c32fbd6ec70532319",
{
input: {
guidance_scale: 4,
height: 1024,
img_weight: 1,
negative_prompt: "ugly, tiling, oversaturated, undersaturated, poorly drawn hands, poorly drawn feet, poorly drawn face, out of frame, extra limbs, disfigured, deformed, body out of frame, blurry, bad anatomy, blurred, watermark, grainy, signature, cut off, draft",
num_inference_steps: 18,
num_outputs: 1,
num_steps_prior: 2,
prompt: "A alien cheeseburger creature eating itself, claymation, cinematic, moody lighting",
scheduler: "unipc",
task: "text2img",
width: 1024
}
}
);
// To access the file URL:
console.log(output[0].url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", output[0]);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Bqq**********************************
This is your API token. Keep it to yourself.
import replicate
Run adalab-ai/kandinsky_v2_2 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"adalab-ai/kandinsky_v2_2:eb68c00d7fc7d7297a04dcecbdd29032361ab8f1d3f6843c32fbd6ec70532319",
input={
"guidance_scale": 4,
"height": 1024,
"img_weight": 1,
"negative_prompt": "ugly, tiling, oversaturated, undersaturated, poorly drawn hands, poorly drawn feet, poorly drawn face, out of frame, extra limbs, disfigured, deformed, body out of frame, blurry, bad anatomy, blurred, watermark, grainy, signature, cut off, draft",
"num_inference_steps": 18,
"num_outputs": 1,
"num_steps_prior": 2,
"prompt": "A alien cheeseburger creature eating itself, claymation, cinematic, moody lighting",
"scheduler": "unipc",
"task": "text2img",
"width": 1024
}
)
# To access the file URL:
print(output[0].url())
#=> "http://example.com"
# To write the file to disk:
with open("my-image.png", "wb") as file:
file.write(output[0].read())
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Bqq**********************************
This is your API token. Keep it to yourself.
Run adalab-ai/kandinsky_v2_2 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Prefer: wait" \
-d $'{
"version": "adalab-ai/kandinsky_v2_2:eb68c00d7fc7d7297a04dcecbdd29032361ab8f1d3f6843c32fbd6ec70532319",
"input": {
"guidance_scale": 4,
"height": 1024,
"img_weight": 1,
"negative_prompt": "ugly, tiling, oversaturated, undersaturated, poorly drawn hands, poorly drawn feet, poorly drawn face, out of frame, extra limbs, disfigured, deformed, body out of frame, blurry, bad anatomy, blurred, watermark, grainy, signature, cut off, draft",
"num_inference_steps": 18,
"num_outputs": 1,
"num_steps_prior": 2,
"prompt": "A alien cheeseburger creature eating itself, claymation, cinematic, moody lighting",
"scheduler": "unipc",
"task": "text2img",
"width": 1024
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "i5urxqbb5h7xc6p2tjwxyhbsw4",
"model": "adalab-ai/kandinsky_v2_2",
"version": "eb68c00d7fc7d7297a04dcecbdd29032361ab8f1d3f6843c32fbd6ec70532319",
"input": {
"guidance_scale": 4,
"height": 1024,
"img_weight": 1,
"negative_prompt": "ugly, tiling, oversaturated, undersaturated, poorly drawn hands, poorly drawn feet, poorly drawn face, out of frame, extra limbs, disfigured, deformed, body out of frame, blurry, bad anatomy, blurred, watermark, grainy, signature, cut off, draft",
"num_inference_steps": 18,
"num_outputs": 1,
"num_steps_prior": 2,
"prompt": "A alien cheeseburger creature eating itself, claymation, cinematic, moody lighting",
"scheduler": "unipc",
"task": "text2img",
"width": 1024
},
"logs": "Using seed: 47117\n 0%| | 0/2 [00:00<?, ?it/s]\n100%|██████████| 2/2 [00:00<00:00, 44.94it/s]\n 0%| | 0/2 [00:00<?, ?it/s]\n100%|██████████| 2/2 [00:00<00:00, 45.88it/s]\n 0%| | 0/18 [00:00<?, ?it/s]\n 6%|▌ | 1/18 [00:00<00:02, 6.39it/s]\n 17%|█▋ | 3/18 [00:00<00:01, 9.28it/s]\n 28%|██▊ | 5/18 [00:00<00:01, 10.58it/s]\n 39%|███▉ | 7/18 [00:00<00:00, 11.20it/s]\n 50%|█████ | 9/18 [00:00<00:00, 11.55it/s]\n 61%|██████ | 11/18 [00:00<00:00, 11.76it/s]\n 72%|███████▏ | 13/18 [00:01<00:00, 11.89it/s]\n 83%|████████▎ | 15/18 [00:01<00:00, 11.96it/s]\n 94%|█████████▍| 17/18 [00:01<00:00, 12.01it/s]\n100%|██████████| 18/18 [00:01<00:00, 11.45it/s]",
"output": [
"https://replicate.delivery/pbxt/UWJyuHmKzaoRExhMNj0AUIxYkMGqjgr1zNOs6uWd6MfEAjoIA/out-0.png"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-07-18T15:21:43.191497Z",
"started_at": "2023-07-18T15:21:43.150382Z",
"completed_at": "2023-07-18T15:21:46.400543Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/i5urxqbb5h7xc6p2tjwxyhbsw4/cancel",
"get": "https://api.replicate.com/v1/predictions/i5urxqbb5h7xc6p2tjwxyhbsw4"
},
"metrics": {
"predict_time": 3.250161,
"total_time": 3.209046
}
}