typetext
{
"control_image": "https://replicate.delivery/pbxt/MW4aBFDCHSUGpGUt7jOHtlJUbHuD01AONTRoR7odtLEaCItL/coffee.png",
"guidance_scale": 3.5,
"num_inference_steps": 8,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 80,
"prompt": "In a bright room. A cup of a coffee with some beans on the side. They are placed on a dark wooden table.",
"seed": 42,
"task": "coloring"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_F8s**********************************
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 jhorovitz/omini-dev using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"jhorovitz/omini-dev:807c3a225037898bf5cb98c6c267c627d5ec164acd79c490972e38ba74153ec0",
{
input: {
control_image: "https://replicate.delivery/pbxt/MW4aBFDCHSUGpGUt7jOHtlJUbHuD01AONTRoR7odtLEaCItL/coffee.png",
guidance_scale: 3.5,
num_inference_steps: 8,
num_outputs: 1,
output_format: "webp",
output_quality: 80,
prompt: "In a bright room. A cup of a coffee with some beans on the side. They are placed on a dark wooden table.",
seed: 42,
task: "coloring"
}
}
);
// 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_F8s**********************************
This is your API token. Keep it to yourself.
import replicate
Run jhorovitz/omini-dev using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"jhorovitz/omini-dev:807c3a225037898bf5cb98c6c267c627d5ec164acd79c490972e38ba74153ec0",
input={
"control_image": "https://replicate.delivery/pbxt/MW4aBFDCHSUGpGUt7jOHtlJUbHuD01AONTRoR7odtLEaCItL/coffee.png",
"guidance_scale": 3.5,
"num_inference_steps": 8,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 80,
"prompt": "In a bright room. A cup of a coffee with some beans on the side. They are placed on a dark wooden table.",
"seed": 42,
"task": "coloring"
}
)
# 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_F8s**********************************
This is your API token. Keep it to yourself.
Run jhorovitz/omini-dev 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": "jhorovitz/omini-dev:807c3a225037898bf5cb98c6c267c627d5ec164acd79c490972e38ba74153ec0",
"input": {
"control_image": "https://replicate.delivery/pbxt/MW4aBFDCHSUGpGUt7jOHtlJUbHuD01AONTRoR7odtLEaCItL/coffee.png",
"guidance_scale": 3.5,
"num_inference_steps": 8,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 80,
"prompt": "In a bright room. A cup of a coffee with some beans on the side. They are placed on a dark wooden table.",
"seed": 42,
"task": "coloring"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "we46ex4ahxrj00cn2n5bxnsn40",
"model": "jhorovitz/omini-dev",
"version": "807c3a225037898bf5cb98c6c267c627d5ec164acd79c490972e38ba74153ec0",
"input": {
"control_image": "https://replicate.delivery/pbxt/MW4aBFDCHSUGpGUt7jOHtlJUbHuD01AONTRoR7odtLEaCItL/coffee.png",
"guidance_scale": 3.5,
"num_inference_steps": 8,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 80,
"prompt": "In a bright room. A cup of a coffee with some beans on the side. They are placed on a dark wooden table.",
"seed": 42,
"task": "coloring"
},
"logs": "Using seed: 42\n 0%| | 0/8 [00:00<?, ?it/s]\n 12%|█▎ | 1/8 [00:00<00:02, 3.12it/s]\n 25%|██▌ | 2/8 [00:00<00:01, 3.33it/s]\n 38%|███▊ | 3/8 [00:00<00:01, 3.23it/s]\n 50%|█████ | 4/8 [00:01<00:01, 3.19it/s]\n 62%|██████▎ | 5/8 [00:01<00:00, 3.17it/s]\n 75%|███████▌ | 6/8 [00:01<00:00, 3.15it/s]\n 88%|████████▊ | 7/8 [00:02<00:00, 3.14it/s]\n100%|██████████| 8/8 [00:02<00:00, 3.14it/s]\n100%|██████████| 8/8 [00:02<00:00, 3.16it/s]",
"output": [
"https://replicate.delivery/yhqm/sfd161ArsO0nJKfTqxISNS62OjNV9VyVa6fXbsBpdJeQdOBRB/out-0.webp"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-02-17T19:02:41.551Z",
"started_at": "2025-02-17T19:02:41.971649Z",
"completed_at": "2025-02-17T19:02:44.863551Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/we46ex4ahxrj00cn2n5bxnsn40/cancel",
"get": "https://api.replicate.com/v1/predictions/we46ex4ahxrj00cn2n5bxnsn40",
"stream": "https://stream.replicate.com/v1/files/yswh-dvk6f3ixr5sbq6hmbwg4tn6gat3zwxy6rquln5gymktsusnq7j4a",
"web": "https://replicate.com/p/we46ex4ahxrj00cn2n5bxnsn40"
},
"metrics": {
"predict_time": 2.891901895,
"total_time": 3.312551
}
}
