typetext
{
"cfg": 5,
"height": 1024,
"negative_prompt": "",
"number_of_images": 1,
"output_format": "webp",
"output_quality": 80,
"prompt": "a kingfisher saying \"hello\" in a speech bubble",
"scheduler": "EulerDiscreteScheduler",
"steps": 25,
"width": 1024
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Mfp**********************************
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 fofr/kolors using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"fofr/kolors:05df67f7cf9d1cc4a07af44340d92aa48df89601a30e9b76523addcad3a00bca",
{
input: {
cfg: 5,
height: 1024,
negative_prompt: "",
number_of_images: 1,
output_format: "webp",
output_quality: 80,
prompt: "a kingfisher saying \"hello\" in a speech bubble",
scheduler: "EulerDiscreteScheduler",
steps: 25,
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_Mfp**********************************
This is your API token. Keep it to yourself.
import replicate
Run fofr/kolors using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"fofr/kolors:05df67f7cf9d1cc4a07af44340d92aa48df89601a30e9b76523addcad3a00bca",
input={
"cfg": 5,
"height": 1024,
"negative_prompt": "",
"number_of_images": 1,
"output_format": "webp",
"output_quality": 80,
"prompt": "a kingfisher saying \"hello\" in a speech bubble",
"scheduler": "EulerDiscreteScheduler",
"steps": 25,
"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_Mfp**********************************
This is your API token. Keep it to yourself.
Run fofr/kolors 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": "fofr/kolors:05df67f7cf9d1cc4a07af44340d92aa48df89601a30e9b76523addcad3a00bca",
"input": {
"cfg": 5,
"height": 1024,
"negative_prompt": "",
"number_of_images": 1,
"output_format": "webp",
"output_quality": 80,
"prompt": "a kingfisher saying \\"hello\\" in a speech bubble",
"scheduler": "EulerDiscreteScheduler",
"steps": 25,
"width": 1024
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "cdz12h2gehrgg0cgjbh8kteym4",
"model": "fofr/kolors",
"version": "05df67f7cf9d1cc4a07af44340d92aa48df89601a30e9b76523addcad3a00bca",
"input": {
"cfg": 5,
"height": 1024,
"negative_prompt": "",
"number_of_images": 1,
"output_format": "webp",
"output_quality": 80,
"prompt": "a kingfisher saying \"hello\" in a speech bubble",
"scheduler": "EulerDiscreteScheduler",
"steps": 25,
"width": 1024
},
"logs": "Random seed set to: 2209112854\nRunning workflow\ngot prompt\nExecuting node 2, title: Kolors Sampler, class type: KolorsSampler\n 0%| | 0/25 [00:00<?, ?it/s]\n 8%|▊ | 2/25 [00:00<00:03, 7.09it/s]\n 12%|█▏ | 3/25 [00:00<00:03, 6.17it/s]\n 16%|█▌ | 4/25 [00:00<00:03, 5.76it/s]\n 20%|██ | 5/25 [00:00<00:03, 5.55it/s]\n 24%|██▍ | 6/25 [00:01<00:03, 5.40it/s]\n 28%|██▊ | 7/25 [00:01<00:03, 5.32it/s]\n 32%|███▏ | 8/25 [00:01<00:03, 5.27it/s]\n 36%|███▌ | 9/25 [00:01<00:03, 5.24it/s]\n 40%|████ | 10/25 [00:01<00:02, 5.22it/s]\n 44%|████▍ | 11/25 [00:02<00:02, 5.19it/s]\n 48%|████▊ | 12/25 [00:02<00:02, 5.18it/s]\n 52%|█████▏ | 13/25 [00:02<00:02, 5.17it/s]\n 56%|█████▌ | 14/25 [00:02<00:02, 5.17it/s]\n 60%|██████ | 15/25 [00:02<00:01, 5.17it/s]\n 64%|██████▍ | 16/25 [00:02<00:01, 5.16it/s]\n 68%|██████▊ | 17/25 [00:03<00:01, 5.15it/s]\n 72%|███████▏ | 18/25 [00:03<00:01, 5.15it/s]\n 76%|███████▌ | 19/25 [00:03<00:01, 5.15it/s]\n 80%|████████ | 20/25 [00:03<00:00, 5.15it/s]\n 84%|████████▍ | 21/25 [00:03<00:00, 5.15it/s]\n 88%|████████▊ | 22/25 [00:04<00:00, 5.15it/s]\n 92%|█████████▏| 23/25 [00:04<00:00, 5.15it/s]\n 96%|█████████▌| 24/25 [00:04<00:00, 5.15it/s]\n100%|██████████| 25/25 [00:04<00:00, 5.15it/s]\n100%|██████████| 25/25 [00:04<00:00, 5.27it/s]\nExecuting node 7, title: VAE Decode, class type: VAEDecode\nExecuting node 9, title: Save Image, class type: SaveImage\nPrompt executed in 5.38 seconds\noutputs: {'9': {'images': [{'filename': 'R8_Kolor_00001_.png', 'subfolder': '', 'type': 'output'}]}}\n====================================\nR8_Kolor_00001_.png",
"output": [
"https://replicate.delivery/pbxt/D1xnP9anGMLMKdNgEz8IM8VRMxb1fDmm6waHBZ2YeAhdKbGTA/R8_Kolor_00001_.webp"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-07-08T15:07:03.668Z",
"started_at": "2024-07-08T15:07:03.677876Z",
"completed_at": "2024-07-08T15:07:09.536014Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/cdz12h2gehrgg0cgjbh8kteym4/cancel",
"get": "https://api.replicate.com/v1/predictions/cdz12h2gehrgg0cgjbh8kteym4",
"web": "https://replicate.com/p/cdz12h2gehrgg0cgjbh8kteym4"
},
"metrics": {
"predict_time": 5.858137734,
"total_time": 5.868014
}
}