typetext
{
"guidance_scale": 3.5,
"height": 1024,
"num_inference_steps": 4,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 80,
"prompt": "A cartoon drawing of a car.",
"redux": "https://replicate.delivery/pbxt/MHocNcBT9rCyEg704LnolXXFDwf10UzowHqvJ2bYJ83CdCEa/car.webp",
"redux_strength": 0.03,
"seed": 42,
"width": 1024
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Pj1**********************************
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/flux-schnell-redux-control using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"jhorovitz/flux-schnell-redux-control:2f9ed928d83b752b12759c7eb713a0cb61220827a3143cf65827ce4de1632102",
{
input: {
guidance_scale: 3.5,
height: 1024,
num_inference_steps: 4,
num_outputs: 1,
output_format: "webp",
output_quality: 80,
prompt: "A cartoon drawing of a car.",
redux: "https://replicate.delivery/pbxt/MHocNcBT9rCyEg704LnolXXFDwf10UzowHqvJ2bYJ83CdCEa/car.webp",
redux_strength: 0.03,
seed: 42,
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_Pj1**********************************
This is your API token. Keep it to yourself.
import replicate
Run jhorovitz/flux-schnell-redux-control using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"jhorovitz/flux-schnell-redux-control:2f9ed928d83b752b12759c7eb713a0cb61220827a3143cf65827ce4de1632102",
input={
"guidance_scale": 3.5,
"height": 1024,
"num_inference_steps": 4,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 80,
"prompt": "A cartoon drawing of a car.",
"redux": "https://replicate.delivery/pbxt/MHocNcBT9rCyEg704LnolXXFDwf10UzowHqvJ2bYJ83CdCEa/car.webp",
"redux_strength": 0.03,
"seed": 42,
"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_Pj1**********************************
This is your API token. Keep it to yourself.
Run jhorovitz/flux-schnell-redux-control 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/flux-schnell-redux-control:2f9ed928d83b752b12759c7eb713a0cb61220827a3143cf65827ce4de1632102",
"input": {
"guidance_scale": 3.5,
"height": 1024,
"num_inference_steps": 4,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 80,
"prompt": "A cartoon drawing of a car.",
"redux": "https://replicate.delivery/pbxt/MHocNcBT9rCyEg704LnolXXFDwf10UzowHqvJ2bYJ83CdCEa/car.webp",
"redux_strength": 0.03,
"seed": 42,
"width": 1024
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "jwbeh3gd7nrme0cm8sz9dtpasc",
"model": "jhorovitz/flux-schnell-redux-control",
"version": "2f9ed928d83b752b12759c7eb713a0cb61220827a3143cf65827ce4de1632102",
"input": {
"guidance_scale": 3.5,
"height": 1024,
"num_inference_steps": 4,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 80,
"prompt": "A cartoon drawing of a car.",
"redux": "https://replicate.delivery/pbxt/MHocNcBT9rCyEg704LnolXXFDwf10UzowHqvJ2bYJ83CdCEa/car.webp",
"redux_strength": 0.03,
"seed": 42,
"width": 1024
},
"logs": "Using seed: 42\n 0%| | 0/4 [00:00<?, ?it/s]\n 25%|██▌ | 1/4 [00:00<00:02, 1.11it/s]\n 50%|█████ | 2/4 [00:01<00:01, 1.32it/s]\n 75%|███████▌ | 3/4 [00:02<00:00, 1.22it/s]\n100%|██████████| 4/4 [00:03<00:00, 1.17it/s]\n100%|██████████| 4/4 [00:03<00:00, 1.19it/s]",
"output": [
"https://replicate.delivery/xezq/YSy5w8CW0Ea7I9DxsD8Tlf2Gb4hBxtnexfuHtVa2jSe3VSMQB/out-0.webp"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-01-08T15:17:33.629Z",
"started_at": "2025-01-08T15:18:50.02791Z",
"completed_at": "2025-01-08T15:18:53.950249Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/jwbeh3gd7nrme0cm8sz9dtpasc/cancel",
"get": "https://api.replicate.com/v1/predictions/jwbeh3gd7nrme0cm8sz9dtpasc",
"stream": "https://stream.replicate.com/v1/files/bcwr-yjma4joikji4jootqpvu6qzutk4ehh5mjgxc5nlnguhxh7ce2sca",
"web": "https://replicate.com/p/jwbeh3gd7nrme0cm8sz9dtpasc"
},
"metrics": {
"predict_time": 3.922339666,
"total_time": 80.321249
}
}
