You're looking at a specific version of this model. Jump to the model overview.
ai-forever /kandinsky-2:65a15f6e
Input
Run this model in Node.js with one line of code:
npm install replicate
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
import Replicate from "replicate";
import fs from "node:fs";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run ai-forever/kandinsky-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:65a15f6e3c538ee4adf5142411455308926714f7d3f5c940d9f7bc519e0e5c1a",
{
input: {
prompt: "a beautiful landscape photo, epic, dawn light, 8k, mountains, river, dramatic, award winning",
scheduler: "p_sampler",
prior_steps: "5",
guidance_scale: 4,
prior_cf_scale: 4,
num_inference_steps: 100
}
}
);
// To access the file URL:
console.log(output.url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", output);
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=<paste-your-token-here>
Find your API token in your account settings.
import replicate
Run ai-forever/kandinsky-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:65a15f6e3c538ee4adf5142411455308926714f7d3f5c940d9f7bc519e0e5c1a",
input={
"prompt": "a beautiful landscape photo, epic, dawn light, 8k, mountains, river, dramatic, award winning",
"scheduler": "p_sampler",
"prior_steps": "5",
"guidance_scale": 4,
"prior_cf_scale": 4,
"num_inference_steps": 100
}
)
print(output)
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Run ai-forever/kandinsky-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:65a15f6e3c538ee4adf5142411455308926714f7d3f5c940d9f7bc519e0e5c1a",
"input": {
"prompt": "a beautiful landscape photo, epic, dawn light, 8k, mountains, river, dramatic, award winning",
"scheduler": "p_sampler",
"prior_steps": "5",
"guidance_scale": 4,
"prior_cf_scale": 4,
"num_inference_steps": 100
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Add a payment method to run this model.
By signing in, you agree to our
terms of service and privacy policy
Output
{
"completed_at": "2023-04-11T20:03:23.641162Z",
"created_at": "2023-04-11T20:03:06.746357Z",
"data_removed": false,
"error": null,
"id": "xi43ss7qpnf6beckaoulfk7xca",
"input": {
"prompt": "a beautiful landscape photo, epic, dawn light, 8k, mountains, river, dramatic, award winning",
"scheduler": "p_sampler",
"prior_steps": "5",
"guidance_scale": 4,
"prior_cf_scale": 4,
"num_inference_steps": 100
},
"logs": "0%| | 0/100 [00:00<?, ?it/s]\n 2%|▏ | 2/100 [00:00<00:08, 11.31it/s]\n 4%|▍ | 4/100 [00:00<00:08, 11.29it/s]\n 6%|▌ | 6/100 [00:00<00:08, 11.41it/s]\n 8%|▊ | 8/100 [00:00<00:08, 11.43it/s]\n 10%|█ | 10/100 [00:00<00:07, 11.46it/s]\n 12%|█▏ | 12/100 [00:01<00:07, 11.47it/s]\n 14%|█▍ | 14/100 [00:01<00:07, 11.36it/s]\n 16%|█▌ | 16/100 [00:01<00:07, 11.29it/s]\n 18%|█▊ | 18/100 [00:01<00:07, 11.33it/s]\n 20%|██ | 20/100 [00:01<00:07, 11.36it/s]\n 22%|██▏ | 22/100 [00:01<00:06, 11.37it/s]\n 24%|██▍ | 24/100 [00:02<00:06, 11.40it/s]\n 26%|██▌ | 26/100 [00:02<00:06, 11.35it/s]\n 28%|██▊ | 28/100 [00:02<00:06, 11.37it/s]\n 30%|███ | 30/100 [00:02<00:06, 11.45it/s]\n 32%|███▏ | 32/100 [00:02<00:05, 11.50it/s]\n 34%|███▍ | 34/100 [00:02<00:05, 11.55it/s]\n 36%|███▌ | 36/100 [00:03<00:05, 11.57it/s]\n 38%|███▊ | 38/100 [00:03<00:05, 11.53it/s]\n 40%|████ | 40/100 [00:03<00:05, 11.51it/s]\n 42%|████▏ | 42/100 [00:03<00:05, 11.49it/s]\n 44%|████▍ | 44/100 [00:03<00:04, 11.47it/s]\n 46%|████▌ | 46/100 [00:04<00:04, 11.48it/s]\n 48%|████▊ | 48/100 [00:04<00:04, 11.47it/s]\n 50%|█████ | 50/100 [00:04<00:04, 11.43it/s]\n 52%|█████▏ | 52/100 [00:04<00:04, 11.44it/s]\n 54%|█████▍ | 54/100 [00:04<00:04, 11.41it/s]\n 56%|█████▌ | 56/100 [00:04<00:03, 11.42it/s]\n 58%|█████▊ | 58/100 [00:05<00:03, 11.46it/s]\n 60%|██████ | 60/100 [00:05<00:03, 11.44it/s]\n 62%|██████▏ | 62/100 [00:05<00:03, 11.37it/s]\n 64%|██████▍ | 64/100 [00:05<00:03, 11.29it/s]\n 66%|██████▌ | 66/100 [00:05<00:03, 11.30it/s]\n 68%|██████▊ | 68/100 [00:05<00:02, 11.32it/s]\n 70%|███████ | 70/100 [00:06<00:02, 11.35it/s]\n 72%|███████▏ | 72/100 [00:06<00:02, 11.34it/s]\n 74%|███████▍ | 74/100 [00:06<00:02, 11.35it/s]\n 76%|███████▌ | 76/100 [00:06<00:02, 11.33it/s]\n 78%|███████▊ | 78/100 [00:06<00:01, 11.36it/s]\n 80%|████████ | 80/100 [00:07<00:01, 11.39it/s]\n 82%|████████▏ | 82/100 [00:07<00:01, 11.40it/s]\n 84%|████████▍ | 84/100 [00:07<00:01, 11.26it/s]\n 86%|████████▌ | 86/100 [00:07<00:01, 11.29it/s]\n 88%|████████▊ | 88/100 [00:07<00:01, 11.34it/s]\n 90%|█████████ | 90/100 [00:07<00:00, 11.39it/s]\n 92%|█████████▏| 92/100 [00:08<00:00, 11.40it/s]\n 94%|█████████▍| 94/100 [00:08<00:00, 11.21it/s]\n 96%|█████████▌| 96/100 [00:08<00:00, 11.28it/s]\n 98%|█████████▊| 98/100 [00:08<00:00, 11.32it/s]\n100%|██████████| 100/100 [00:08<00:00, 11.36it/s]\n100%|██████████| 100/100 [00:08<00:00, 11.39it/s]",
"metrics": {
"predict_time": 10.060902,
"total_time": 16.894805
},
"output": "https://replicate.delivery/pbxt/iQKHCerzd4wEPyRNbJYhTqeKNhRxwqiaYgyLAN09mEaK82wQA/out.png",
"started_at": "2023-04-11T20:03:13.580260Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/xi43ss7qpnf6beckaoulfk7xca",
"cancel": "https://api.replicate.com/v1/predictions/xi43ss7qpnf6beckaoulfk7xca/cancel"
},
"version": "65a15f6e3c538ee4adf5142411455308926714f7d3f5c940d9f7bc519e0e5c1a"
}
0%| | 0/100 [00:00<?, ?it/s]
2%|▏ | 2/100 [00:00<00:08, 11.31it/s]
4%|▍ | 4/100 [00:00<00:08, 11.29it/s]
6%|▌ | 6/100 [00:00<00:08, 11.41it/s]
8%|▊ | 8/100 [00:00<00:08, 11.43it/s]
10%|█ | 10/100 [00:00<00:07, 11.46it/s]
12%|█▏ | 12/100 [00:01<00:07, 11.47it/s]
14%|█▍ | 14/100 [00:01<00:07, 11.36it/s]
16%|█▌ | 16/100 [00:01<00:07, 11.29it/s]
18%|█▊ | 18/100 [00:01<00:07, 11.33it/s]
20%|██ | 20/100 [00:01<00:07, 11.36it/s]
22%|██▏ | 22/100 [00:01<00:06, 11.37it/s]
24%|██▍ | 24/100 [00:02<00:06, 11.40it/s]
26%|██▌ | 26/100 [00:02<00:06, 11.35it/s]
28%|██▊ | 28/100 [00:02<00:06, 11.37it/s]
30%|███ | 30/100 [00:02<00:06, 11.45it/s]
32%|███▏ | 32/100 [00:02<00:05, 11.50it/s]
34%|███▍ | 34/100 [00:02<00:05, 11.55it/s]
36%|███▌ | 36/100 [00:03<00:05, 11.57it/s]
38%|███▊ | 38/100 [00:03<00:05, 11.53it/s]
40%|████ | 40/100 [00:03<00:05, 11.51it/s]
42%|████▏ | 42/100 [00:03<00:05, 11.49it/s]
44%|████▍ | 44/100 [00:03<00:04, 11.47it/s]
46%|████▌ | 46/100 [00:04<00:04, 11.48it/s]
48%|████▊ | 48/100 [00:04<00:04, 11.47it/s]
50%|█████ | 50/100 [00:04<00:04, 11.43it/s]
52%|█████▏ | 52/100 [00:04<00:04, 11.44it/s]
54%|█████▍ | 54/100 [00:04<00:04, 11.41it/s]
56%|█████▌ | 56/100 [00:04<00:03, 11.42it/s]
58%|█████▊ | 58/100 [00:05<00:03, 11.46it/s]
60%|██████ | 60/100 [00:05<00:03, 11.44it/s]
62%|██████▏ | 62/100 [00:05<00:03, 11.37it/s]
64%|██████▍ | 64/100 [00:05<00:03, 11.29it/s]
66%|██████▌ | 66/100 [00:05<00:03, 11.30it/s]
68%|██████▊ | 68/100 [00:05<00:02, 11.32it/s]
70%|███████ | 70/100 [00:06<00:02, 11.35it/s]
72%|███████▏ | 72/100 [00:06<00:02, 11.34it/s]
74%|███████▍ | 74/100 [00:06<00:02, 11.35it/s]
76%|███████▌ | 76/100 [00:06<00:02, 11.33it/s]
78%|███████▊ | 78/100 [00:06<00:01, 11.36it/s]
80%|████████ | 80/100 [00:07<00:01, 11.39it/s]
82%|████████▏ | 82/100 [00:07<00:01, 11.40it/s]
84%|████████▍ | 84/100 [00:07<00:01, 11.26it/s]
86%|████████▌ | 86/100 [00:07<00:01, 11.29it/s]
88%|████████▊ | 88/100 [00:07<00:01, 11.34it/s]
90%|█████████ | 90/100 [00:07<00:00, 11.39it/s]
92%|█████████▏| 92/100 [00:08<00:00, 11.40it/s]
94%|█████████▍| 94/100 [00:08<00:00, 11.21it/s]
96%|█████████▌| 96/100 [00:08<00:00, 11.28it/s]
98%|█████████▊| 98/100 [00:08<00:00, 11.32it/s]
100%|██████████| 100/100 [00:08<00:00, 11.36it/s]
100%|██████████| 100/100 [00:08<00:00, 11.39it/s]