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 cyberpunk llama soaring through the air",
"width": 1024
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_FI3**********************************
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 cyberpunk llama soaring through the air",
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_FI3**********************************
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 cyberpunk llama soaring through the air",
"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_FI3**********************************
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 cyberpunk llama soaring through the air",
"width": 1024
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "kbtkpyrbbgg4o77a5hk2vzne4a",
"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 cyberpunk llama soaring through the air",
"width": 1024
},
"logs": "Using seed: 40598\n 0%| | 0/25 [00:00<?, ?it/s]\n 20%|██ | 5/25 [00:00<00:00, 41.67it/s]\n 40%|████ | 10/25 [00:00<00:00, 42.41it/s]\n 60%|██████ | 15/25 [00:00<00:00, 42.55it/s]\n 80%|████████ | 20/25 [00:00<00:00, 42.49it/s]\n100%|██████████| 25/25 [00:00<00:00, 42.49it/s]\n100%|██████████| 25/25 [00:00<00:00, 42.40it/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, 42.97it/s]\n 40%|████ | 10/25 [00:00<00:00, 42.89it/s]\n 60%|██████ | 15/25 [00:00<00:00, 42.27it/s]\n 80%|████████ | 20/25 [00:00<00:00, 42.67it/s]\n100%|██████████| 25/25 [00:00<00:00, 42.84it/s]\n100%|██████████| 25/25 [00:00<00:00, 42.72it/s]\n 0%| | 0/75 [00:00<?, ?it/s]\n 3%|▎ | 2/75 [00:00<00:06, 10.87it/s]\n 5%|▌ | 4/75 [00:00<00:06, 11.24it/s]\n 8%|▊ | 6/75 [00:00<00:05, 11.69it/s]\n 11%|█ | 8/75 [00:00<00:05, 11.92it/s]\n 13%|█▎ | 10/75 [00:00<00:05, 12.03it/s]\n 16%|█▌ | 12/75 [00:01<00:05, 12.11it/s]\n 19%|█▊ | 14/75 [00:01<00:05, 11.88it/s]\n 21%|██▏ | 16/75 [00:01<00:04, 11.99it/s]\n 24%|██▍ | 18/75 [00:01<00:04, 12.00it/s]\n 27%|██▋ | 20/75 [00:01<00:04, 12.08it/s]\n 29%|██▉ | 22/75 [00:01<00:04, 12.14it/s]\n 32%|███▏ | 24/75 [00:02<00:04, 12.18it/s]\n 35%|███▍ | 26/75 [00:02<00:04, 12.21it/s]\n 37%|███▋ | 28/75 [00:02<00:03, 12.24it/s]\n 40%|████ | 30/75 [00:02<00:03, 12.25it/s]\n 43%|████▎ | 32/75 [00:02<00:03, 12.25it/s]\n 45%|████▌ | 34/75 [00:02<00:03, 12.24it/s]\n 48%|████▊ | 36/75 [00:02<00:03, 12.24it/s]\n 51%|█████ | 38/75 [00:03<00:03, 12.25it/s]\n 53%|█████▎ | 40/75 [00:03<00:02, 12.26it/s]\n 56%|█████▌ | 42/75 [00:03<00:02, 12.27it/s]\n 59%|█████▊ | 44/75 [00:03<00:02, 12.26it/s]\n 61%|██████▏ | 46/75 [00:03<00:02, 12.26it/s]\n 64%|██████▍ | 48/75 [00:03<00:02, 12.27it/s]\n 67%|██████▋ | 50/75 [00:04<00:02, 12.27it/s]\n 69%|██████▉ | 52/75 [00:04<00:01, 12.28it/s]\n 72%|███████▏ | 54/75 [00:04<00:01, 12.27it/s]\n 75%|███████▍ | 56/75 [00:04<00:01, 12.26it/s]\n 77%|███████▋ | 58/75 [00:04<00:01, 12.26it/s]\n 80%|████████ | 60/75 [00:04<00:01, 12.26it/s]\n 83%|████████▎ | 62/75 [00:05<00:01, 12.27it/s]\n 85%|████████▌ | 64/75 [00:05<00:00, 12.24it/s]\n 88%|████████▊ | 66/75 [00:05<00:00, 12.24it/s]\n 91%|█████████ | 68/75 [00:05<00:00, 12.24it/s]\n 93%|█████████▎| 70/75 [00:05<00:00, 12.24it/s]\n 96%|█████████▌| 72/75 [00:05<00:00, 12.25it/s]\n 99%|█████████▊| 74/75 [00:06<00:00, 12.25it/s]\n100%|██████████| 75/75 [00:06<00:00, 12.17it/s]",
"output": [
"https://replicate.delivery/pbxt/YOaSNsC0KcbMH5V1BFRMwFM6lSAVK0CtaGpqzmRAZf01uxoIA/out-0.png"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-07-20T00:52:51.525363Z",
"started_at": "2023-07-20T00:52:51.492258Z",
"completed_at": "2023-07-20T00:53:00.573435Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/kbtkpyrbbgg4o77a5hk2vzne4a/cancel",
"get": "https://api.replicate.com/v1/predictions/kbtkpyrbbgg4o77a5hk2vzne4a"
},
"metrics": {
"predict_time": 9.081177,
"total_time": 9.048072
}
}