typetext
{
"control_image": "https://replicate.delivery/pbxt/MW4dM8Ovbefmz957U7hWA1KfTq78jgt4WTBFpBqnCVDnwf1T/coffee.png",
"guidance_scale": 3.5,
"num_inference_steps": 8,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 80,
"prompt": "A red coffee cup sits on a table next to a blue candle and a container of coffee beans. more beans are strewn around.",
"seed": 42,
"task": "canny"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Z1k**********************************
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/MW4dM8Ovbefmz957U7hWA1KfTq78jgt4WTBFpBqnCVDnwf1T/coffee.png",
guidance_scale: 3.5,
num_inference_steps: 8,
num_outputs: 1,
output_format: "webp",
output_quality: 80,
prompt: "A red coffee cup sits on a table next to a blue candle and a container of coffee beans. more beans are strewn around.",
seed: 42,
task: "canny"
}
}
);
// 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_Z1k**********************************
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/MW4dM8Ovbefmz957U7hWA1KfTq78jgt4WTBFpBqnCVDnwf1T/coffee.png",
"guidance_scale": 3.5,
"num_inference_steps": 8,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 80,
"prompt": "A red coffee cup sits on a table next to a blue candle and a container of coffee beans. more beans are strewn around.",
"seed": 42,
"task": "canny"
}
)
# 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_Z1k**********************************
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/MW4dM8Ovbefmz957U7hWA1KfTq78jgt4WTBFpBqnCVDnwf1T/coffee.png",
"guidance_scale": 3.5,
"num_inference_steps": 8,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 80,
"prompt": "A red coffee cup sits on a table next to a blue candle and a container of coffee beans. more beans are strewn around.",
"seed": 42,
"task": "canny"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "9c61tnj8msrj60cn2n4r935em0",
"model": "jhorovitz/omini-dev",
"version": "807c3a225037898bf5cb98c6c267c627d5ec164acd79c490972e38ba74153ec0",
"input": {
"control_image": "https://replicate.delivery/pbxt/MW4dM8Ovbefmz957U7hWA1KfTq78jgt4WTBFpBqnCVDnwf1T/coffee.png",
"guidance_scale": 3.5,
"num_inference_steps": 8,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 80,
"prompt": "A red coffee cup sits on a table next to a blue candle and a container of coffee beans. more beans are strewn around.",
"seed": 42,
"task": "canny"
},
"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.34it/s]\n 38%|███▊ | 3/8 [00:00<00:01, 3.24it/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.17it/s]",
"output": [
"https://replicate.delivery/yhqm/CdLRrAw9I6ZxHBHrsUbbAOIV654tZnH2NTRL2eYqIGsBzJIKA/out-0.webp"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-02-17T19:01:19.142Z",
"started_at": "2025-02-17T19:01:20.131075Z",
"completed_at": "2025-02-17T19:01:23.168113Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/9c61tnj8msrj60cn2n4r935em0/cancel",
"get": "https://api.replicate.com/v1/predictions/9c61tnj8msrj60cn2n4r935em0",
"stream": "https://stream.replicate.com/v1/files/yswh-3qouic6msofnwyqaxzyvkapmfkixsc7sej6vh7tnvcophdmqszva",
"web": "https://replicate.com/p/9c61tnj8msrj60cn2n4r935em0"
},
"metrics": {
"predict_time": 3.037037788,
"total_time": 4.026113
}
}
