defaultA moss covered astronaut with a black background
typetext
{
"height": 1024,
"num_inference_steps": 75,
"num_inference_steps_prior": 25,
"num_outputs": 1,
"prompt": "A stampede of futuristic llamas with dust",
"width": 1024
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_dX3**********************************
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 ai-forever/kandinsky-2.2 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"ai-forever/kandinsky-2.2:ea1addaab376f4dc227f5368bbd8eff901820fd1cc14ed8cad63b29249e9d463",
{
input: {
height: 1024,
num_inference_steps: 75,
num_inference_steps_prior: 25,
num_outputs: 1,
prompt: "A stampede of futuristic llamas with dust",
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_dX3**********************************
This is your API token. Keep it to yourself.
import replicate
Run ai-forever/kandinsky-2.2 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"ai-forever/kandinsky-2.2:ea1addaab376f4dc227f5368bbd8eff901820fd1cc14ed8cad63b29249e9d463",
input={
"height": 1024,
"num_inference_steps": 75,
"num_inference_steps_prior": 25,
"num_outputs": 1,
"prompt": "A stampede of futuristic llamas with dust",
"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_dX3**********************************
This is your API token. Keep it to yourself.
Run ai-forever/kandinsky-2.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": "ai-forever/kandinsky-2.2:ea1addaab376f4dc227f5368bbd8eff901820fd1cc14ed8cad63b29249e9d463",
"input": {
"height": 1024,
"num_inference_steps": 75,
"num_inference_steps_prior": 25,
"num_outputs": 1,
"prompt": "A stampede of futuristic llamas with dust",
"width": 1024
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "3rrqugrbuwlddcmtokphb6uelm",
"model": "ai-forever/kandinsky-2.2",
"version": "ea1addaab376f4dc227f5368bbd8eff901820fd1cc14ed8cad63b29249e9d463",
"input": {
"height": 1024,
"num_inference_steps": 75,
"num_inference_steps_prior": 25,
"num_outputs": 1,
"prompt": "A stampede of futuristic llamas with dust",
"width": 1024
},
"logs": "Using seed: 31810\n 0%| | 0/25 [00:00<?, ?it/s]\n 20%|██ | 5/25 [00:00<00:00, 42.70it/s]\n 40%|████ | 10/25 [00:00<00:00, 42.48it/s]\n 60%|██████ | 15/25 [00:00<00:00, 41.49it/s]\n 80%|████████ | 20/25 [00:00<00:00, 38.97it/s]\n100%|██████████| 25/25 [00:00<00:00, 39.95it/s]\n100%|██████████| 25/25 [00:00<00:00, 40.35it/s]\nThe following part of your input was truncated because CLIP can only handle sequences up to 77 tokens: ['gross proportions, malformed limbs, missing arms, missing legs, extra arms, extra legs, fused fingers, too many fingers, long neck, username, watermark, signature']\n 0%| | 0/25 [00:00<?, ?it/s]\n 20%|██ | 5/25 [00:00<00:00, 41.95it/s]\n 40%|████ | 10/25 [00:00<00:00, 41.52it/s]\n 60%|██████ | 15/25 [00:00<00:00, 41.56it/s]\n 80%|████████ | 20/25 [00:00<00:00, 41.27it/s]\n100%|██████████| 25/25 [00:00<00:00, 41.64it/s]\n100%|██████████| 25/25 [00:00<00:00, 41.55it/s]\n 0%| | 0/75 [00:00<?, ?it/s]\n 1%|▏ | 1/75 [00:00<00:07, 9.94it/s]\n 4%|▍ | 3/75 [00:00<00:06, 11.36it/s]\n 7%|▋ | 5/75 [00:00<00:05, 11.80it/s]\n 9%|▉ | 7/75 [00:00<00:05, 11.95it/s]\n 12%|█▏ | 9/75 [00:00<00:05, 12.07it/s]\n 15%|█▍ | 11/75 [00:00<00:05, 12.14it/s]\n 17%|█▋ | 13/75 [00:01<00:05, 12.19it/s]\n 20%|██ | 15/75 [00:01<00:04, 12.22it/s]\n 23%|██▎ | 17/75 [00:01<00:04, 12.24it/s]\n 25%|██▌ | 19/75 [00:01<00:04, 12.26it/s]\n 28%|██▊ | 21/75 [00:01<00:04, 12.26it/s]\n 31%|███ | 23/75 [00:01<00:04, 12.26it/s]\n 33%|███▎ | 25/75 [00:02<00:04, 12.27it/s]\n 36%|███▌ | 27/75 [00:02<00:03, 12.26it/s]\n 39%|███▊ | 29/75 [00:02<00:03, 12.26it/s]\n 41%|████▏ | 31/75 [00:02<00:03, 12.26it/s]\n 44%|████▍ | 33/75 [00:02<00:03, 12.26it/s]\n 47%|████▋ | 35/75 [00:02<00:03, 12.26it/s]\n 49%|████▉ | 37/75 [00:03<00:03, 12.26it/s]\n 52%|█████▏ | 39/75 [00:03<00:02, 12.26it/s]\n 55%|█████▍ | 41/75 [00:03<00:02, 12.25it/s]\n 57%|█████▋ | 43/75 [00:03<00:02, 12.26it/s]\n 60%|██████ | 45/75 [00:03<00:02, 12.27it/s]\n 63%|██████▎ | 47/75 [00:03<00:02, 12.27it/s]\n 65%|██████▌ | 49/75 [00:04<00:02, 12.27it/s]\n 68%|██████▊ | 51/75 [00:04<00:01, 12.27it/s]\n 71%|███████ | 53/75 [00:04<00:01, 12.26it/s]\n 73%|███████▎ | 55/75 [00:04<00:01, 12.27it/s]\n 76%|███████▌ | 57/75 [00:04<00:01, 12.27it/s]\n 79%|███████▊ | 59/75 [00:04<00:01, 12.27it/s]\n 81%|████████▏ | 61/75 [00:04<00:01, 12.28it/s]\n 84%|████████▍ | 63/75 [00:05<00:00, 12.28it/s]\n 87%|████████▋ | 65/75 [00:05<00:00, 11.98it/s]\n 89%|████████▉ | 67/75 [00:05<00:00, 12.07it/s]\n 92%|█████████▏| 69/75 [00:05<00:00, 12.13it/s]\n 95%|█████████▍| 71/75 [00:05<00:00, 12.15it/s]\n 97%|█████████▋| 73/75 [00:05<00:00, 12.18it/s]\n100%|██████████| 75/75 [00:06<00:00, 12.20it/s]\n100%|██████████| 75/75 [00:06<00:00, 12.19it/s]",
"output": [
"https://replicate.delivery/pbxt/wf4jOTL4TuUrfUMJ1koLvTosae8pukuhVo7fRJs6c5gcTCHFB/out-0.png"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-07-20T15:47:56.90168Z",
"started_at": "2023-07-20T15:47:58.865335Z",
"completed_at": "2023-07-20T15:48:07.986058Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/3rrqugrbuwlddcmtokphb6uelm/cancel",
"get": "https://api.replicate.com/v1/predictions/3rrqugrbuwlddcmtokphb6uelm"
},
"metrics": {
"predict_time": 9.120723,
"total_time": 11.084378
}
}