typetext
{
"control_image": "https://github.com/jHorovitz/OminiControl/blob/main/assets/book_masked.jpg?raw=true",
"guidance_scale": 3.5,
"num_inference_steps": 8,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 80,
"prompt": "A yellow book with the word 'OMINI' in large font on the cover. The text 'for FLUX' appears at the bottom.",
"seed": 42,
"task": "fill"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_34N**********************************
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://github.com/jHorovitz/OminiControl/blob/main/assets/book_masked.jpg?raw=true",
guidance_scale: 3.5,
num_inference_steps: 8,
num_outputs: 1,
output_format: "webp",
output_quality: 80,
prompt: "A yellow book with the word 'OMINI' in large font on the cover. The text 'for FLUX' appears at the bottom.",
seed: 42,
task: "fill"
}
}
);
// 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_34N**********************************
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://github.com/jHorovitz/OminiControl/blob/main/assets/book_masked.jpg?raw=true",
"guidance_scale": 3.5,
"num_inference_steps": 8,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 80,
"prompt": "A yellow book with the word 'OMINI' in large font on the cover. The text 'for FLUX' appears at the bottom.",
"seed": 42,
"task": "fill"
}
)
# 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_34N**********************************
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://github.com/jHorovitz/OminiControl/blob/main/assets/book_masked.jpg?raw=true",
"guidance_scale": 3.5,
"num_inference_steps": 8,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 80,
"prompt": "A yellow book with the word \'OMINI\' in large font on the cover. The text \'for FLUX\' appears at the bottom.",
"seed": 42,
"task": "fill"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "v28xn7ve3xrj60cn2hvrvfgyc8",
"model": "jhorovitz/omini-dev",
"version": "807c3a225037898bf5cb98c6c267c627d5ec164acd79c490972e38ba74153ec0",
"input": {
"control_image": "https://github.com/jHorovitz/OminiControl/blob/main/assets/book_masked.jpg?raw=true",
"guidance_scale": 3.5,
"num_inference_steps": 8,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 80,
"prompt": "A yellow book with the word 'OMINI' in large font on the cover. The text 'for FLUX' appears at the bottom.",
"seed": 42,
"task": "fill"
},
"logs": "Using seed: 42\n 0%| | 0/8 [00:00<?, ?it/s]\n 12%|█▎ | 1/8 [00:00<00:02, 2.60it/s]\n 25%|██▌ | 2/8 [00:00<00:01, 3.04it/s]\n 38%|███▊ | 3/8 [00:00<00:01, 3.07it/s]\n 50%|█████ | 4/8 [00:01<00:01, 3.09it/s]\n 62%|██████▎ | 5/8 [00:01<00:00, 3.10it/s]\n 75%|███████▌ | 6/8 [00:01<00:00, 3.10it/s]\n 88%|████████▊ | 7/8 [00:02<00:00, 3.11it/s]\n100%|██████████| 8/8 [00:02<00:00, 3.11it/s]\n100%|██████████| 8/8 [00:02<00:00, 3.07it/s]",
"output": [
"https://replicate.delivery/yhqm/Yxwf6wef4efcMiaY1feiG2vBv9SdrSXZ6rOibeF8GlX13SQQUA/out-0.webp"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-02-17T15:12:06.175Z",
"started_at": "2025-02-17T15:16:03.599089Z",
"completed_at": "2025-02-17T15:16:07.709118Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/v28xn7ve3xrj60cn2hvrvfgyc8/cancel",
"get": "https://api.replicate.com/v1/predictions/v28xn7ve3xrj60cn2hvrvfgyc8",
"stream": "https://stream.replicate.com/v1/files/yswh-cgeffzbmfbs35k5s5cwnvtlohwvqgi7hzuhf2qeikjyqmzxlmh5q",
"web": "https://replicate.com/p/v28xn7ve3xrj60cn2hvrvfgyc8"
},
"metrics": {
"predict_time": 4.110029013,
"total_time": 241.534118
}
}