defaultred cat, 4k photo
typetext
{
"batch_size": 1,
"guidance_scale": 4,
"height": "768",
"num_inference_steps": 100,
"prior_cf_scale": 4,
"prior_steps": "5",
"prompt": "old cow based on the pink floyd album atom heart mother",
"scheduler": "p_sampler",
"width": "768"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_K21**********************************
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 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:601eea49d49003e6ea75a11527209c4f510a93e2112c969d548fbb45b9c4f19f",
{
input: {
batch_size: 1,
guidance_scale: 4,
height: "768",
num_inference_steps: 100,
prior_cf_scale: 4,
prior_steps: "5",
prompt: "old cow based on the pink floyd album atom heart mother",
scheduler: "p_sampler",
width: "768"
}
}
);
// 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_K21**********************************
This is your API token. Keep it to yourself.
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:601eea49d49003e6ea75a11527209c4f510a93e2112c969d548fbb45b9c4f19f",
input={
"batch_size": 1,
"guidance_scale": 4,
"height": "768",
"num_inference_steps": 100,
"prior_cf_scale": 4,
"prior_steps": "5",
"prompt": "old cow based on the pink floyd album atom heart mother",
"scheduler": "p_sampler",
"width": "768"
}
)
# 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_K21**********************************
This is your API token. Keep it to yourself.
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:601eea49d49003e6ea75a11527209c4f510a93e2112c969d548fbb45b9c4f19f",
"input": {
"batch_size": 1,
"guidance_scale": 4,
"height": "768",
"num_inference_steps": 100,
"prior_cf_scale": 4,
"prior_steps": "5",
"prompt": "old cow based on the pink floyd album atom heart mother",
"scheduler": "p_sampler",
"width": "768"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "ztcjz6rbbyoyzrfmjuazttrq3a",
"model": "ai-forever/kandinsky-2",
"version": "601eea49d49003e6ea75a11527209c4f510a93e2112c969d548fbb45b9c4f19f",
"input": {
"batch_size": 1,
"guidance_scale": 4,
"height": "768",
"num_inference_steps": 100,
"prior_cf_scale": 4,
"prior_steps": "5",
"prompt": "old cow based on the pink floyd album atom heart mother",
"scheduler": "p_sampler",
"width": "768"
},
"logs": "0%| | 0/100 [00:00<?, ?it/s]\n 1%| | 1/100 [00:00<00:13, 7.11it/s]\n 3%|▎ | 3/100 [00:00<00:09, 9.83it/s]\n 5%|▌ | 5/100 [00:00<00:09, 10.51it/s]\n 7%|▋ | 7/100 [00:00<00:08, 10.87it/s]\n 9%|▉ | 9/100 [00:00<00:08, 11.06it/s]\n 11%|█ | 11/100 [00:01<00:08, 11.05it/s]\n 13%|█▎ | 13/100 [00:01<00:08, 10.87it/s]\n 15%|█▌ | 15/100 [00:01<00:07, 10.99it/s]\n 17%|█▋ | 17/100 [00:01<00:07, 11.08it/s]\n 19%|█▉ | 19/100 [00:01<00:07, 11.16it/s]\n 21%|██ | 21/100 [00:01<00:07, 11.17it/s]\n 23%|██▎ | 23/100 [00:02<00:06, 11.16it/s]\n 25%|██▌ | 25/100 [00:02<00:06, 11.19it/s]\n 27%|██▋ | 27/100 [00:02<00:06, 11.24it/s]\n 29%|██▉ | 29/100 [00:02<00:06, 11.21it/s]\n 31%|███ | 31/100 [00:02<00:06, 11.25it/s]\n 33%|███▎ | 33/100 [00:03<00:06, 11.06it/s]\n 35%|███▌ | 35/100 [00:03<00:05, 11.06it/s]\n 37%|███▋ | 37/100 [00:03<00:05, 11.17it/s]\n 39%|███▉ | 39/100 [00:03<00:05, 11.24it/s]\n 41%|████ | 41/100 [00:03<00:05, 11.24it/s]\n 43%|████▎ | 43/100 [00:03<00:05, 11.11it/s]\n 45%|████▌ | 45/100 [00:04<00:04, 11.06it/s]\n 47%|████▋ | 47/100 [00:04<00:04, 11.05it/s]\n 49%|████▉ | 49/100 [00:04<00:04, 11.09it/s]\n 51%|█████ | 51/100 [00:04<00:04, 11.14it/s]\n 53%|█████▎ | 53/100 [00:04<00:04, 11.19it/s]\n 55%|█████▌ | 55/100 [00:04<00:04, 11.18it/s]\n 57%|█████▋ | 57/100 [00:05<00:03, 11.15it/s]\n 59%|█████▉ | 59/100 [00:05<00:03, 11.19it/s]\n 61%|██████ | 61/100 [00:05<00:03, 11.23it/s]\n 63%|██████▎ | 63/100 [00:05<00:03, 11.25it/s]\n 65%|██████▌ | 65/100 [00:05<00:03, 11.29it/s]\n 67%|██████▋ | 67/100 [00:06<00:02, 11.19it/s]\n 69%|██████▉ | 69/100 [00:06<00:02, 11.22it/s]\n 71%|███████ | 71/100 [00:06<00:02, 11.22it/s]\n 73%|███████▎ | 73/100 [00:06<00:02, 11.25it/s]\n 75%|███████▌ | 75/100 [00:06<00:02, 11.28it/s]\n 77%|███████▋ | 77/100 [00:06<00:02, 11.08it/s]\n 79%|███████▉ | 79/100 [00:07<00:01, 11.06it/s]\n 81%|████████ | 81/100 [00:07<00:01, 11.11it/s]\n 83%|████████▎ | 83/100 [00:07<00:01, 11.15it/s]\n 85%|████████▌ | 85/100 [00:07<00:01, 11.17it/s]\n 87%|████████▋ | 87/100 [00:07<00:01, 11.20it/s]\n 89%|████████▉ | 89/100 [00:08<00:00, 11.21it/s]\n 91%|█████████ | 91/100 [00:08<00:00, 11.28it/s]\n 93%|█████████▎| 93/100 [00:08<00:00, 11.34it/s]\n 95%|█████████▌| 95/100 [00:08<00:00, 11.39it/s]\n 97%|█████████▋| 97/100 [00:08<00:00, 11.35it/s]\n 99%|█████████▉| 99/100 [00:08<00:00, 11.39it/s]\n100%|██████████| 100/100 [00:08<00:00, 11.14it/s]",
"output": [
"https://replicate.delivery/pbxt/fN2T8Opk14TKUyyFuFZrg8AFGsSHrmKeNIBkoPC23yzaTtLRA/out_0.png"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-07-02T07:10:06.637564Z",
"started_at": "2023-07-02T07:10:08.92481Z",
"completed_at": "2023-07-02T07:10:19.498911Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/ztcjz6rbbyoyzrfmjuazttrq3a/cancel",
"get": "https://api.replicate.com/v1/predictions/ztcjz6rbbyoyzrfmjuazttrq3a"
},
"metrics": {
"predict_time": 10.574101,
"total_time": 12.861347
}
}