typetext
{
"aspect_ratio": "3:4",
"image_prompt_strength": 0.1,
"output_format": "jpg",
"prompt": "beautiful latina girl, sitting in a car, wearing a red sweater, looking at the camera",
"raw": true,
"safety_tolerance": 2
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_CTJ**********************************
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 black-forest-labs/flux-1.1-pro-ultra using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
aspect_ratio: "3:4",
image_prompt_strength: 0.1,
output_format: "jpg",
prompt: "beautiful latina girl, sitting in a car, wearing a red sweater, looking at the camera",
raw: true,
safety_tolerance: 2
};
const output = await replicate.run("black-forest-labs/flux-1.1-pro-ultra", { input });
// To access the file URL:
console.log(output.url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", output);
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_CTJ**********************************
This is your API token. Keep it to yourself.
import replicate
Run black-forest-labs/flux-1.1-pro-ultra using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"black-forest-labs/flux-1.1-pro-ultra",
input={
"aspect_ratio": "3:4",
"image_prompt_strength": 0.1,
"output_format": "jpg",
"prompt": "beautiful latina girl, sitting in a car, wearing a red sweater, looking at the camera",
"raw": True,
"safety_tolerance": 2
}
)
# To access the file URL:
print(output.url())
#=> "http://example.com"
# To write the file to disk:
with open("my-image.png", "wb") as file:
file.write(output.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_CTJ**********************************
This is your API token. Keep it to yourself.
Run black-forest-labs/flux-1.1-pro-ultra 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 $'{
"input": {
"aspect_ratio": "3:4",
"image_prompt_strength": 0.1,
"output_format": "jpg",
"prompt": "beautiful latina girl, sitting in a car, wearing a red sweater, looking at the camera",
"raw": true,
"safety_tolerance": 2
}
}' \
https://api.replicate.com/v1/models/black-forest-labs/flux-1.1-pro-ultra/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "pfv5jmpvwdrmc0cmzd7skvkr1w",
"model": "black-forest-labs/flux-1.1-pro-ultra",
"version": "hidden",
"input": {
"aspect_ratio": "3:4",
"image_prompt_strength": 0.1,
"output_format": "jpg",
"prompt": "beautiful latina girl, sitting in a car, wearing a red sweater, looking at the camera",
"raw": true,
"safety_tolerance": 2
},
"logs": "Running prediction... \nUsing seed: 49250\nGenerating image...\nGenerated image in 8.5sec\nDownloaded image in 0.08sec",
"output": "https://replicate.delivery/xezq/Ki0Z70VpFzJDLNhLfOLRKq2mmaZRpGifpFgeTuWWWpzPaSdoA/tmpx6m3pems.jpg",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-02-12T17:58:22.435Z",
"started_at": "2025-02-12T17:58:22.436893Z",
"completed_at": "2025-02-12T17:58:31.064592Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/pfv5jmpvwdrmc0cmzd7skvkr1w/cancel",
"get": "https://api.replicate.com/v1/predictions/pfv5jmpvwdrmc0cmzd7skvkr1w",
"stream": "https://stream.replicate.com/v1/files/bcwr-76idpxkpgpx777ynkct5agkgxoka57aznbzfajjnuncrfehazfdq",
"web": "https://replicate.com/p/pfv5jmpvwdrmc0cmzd7skvkr1w"
},
"metrics": {
"image_count": 1,
"predict_time": 8.627699358,
"total_time": 8.629592
}
}