typetext
{
"guidance": 60,
"image": "https://replicate.delivery/pbxt/N5rQeSTvbjlApLOqeYZLyENUsuvQCuLmxVmRU5QyTYNGXB7A/bf43e827cbe61cde0b5c4516281ef1e4.jpeg",
"outpaint": "Bottom outpaint",
"output_format": "jpg",
"prompt": "Simple, minimalistic, smooth, natural, seamless background, just simple colors and textures, pure background, same color palette, all colors uniform with original image, smooth, simplistic",
"prompt_upsampling": false,
"safety_tolerance": 2,
"seed": 0,
"steps": 50
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_acs**********************************
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-fill-pro using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
guidance: 60,
image: "https://replicate.delivery/pbxt/N5rQeSTvbjlApLOqeYZLyENUsuvQCuLmxVmRU5QyTYNGXB7A/bf43e827cbe61cde0b5c4516281ef1e4.jpeg",
outpaint: "Bottom outpaint",
output_format: "jpg",
prompt: "Simple, minimalistic, smooth, natural, seamless background, just simple colors and textures, pure background, same color palette, all colors uniform with original image, smooth, simplistic",
prompt_upsampling: false,
safety_tolerance: 2,
seed: 0,
steps: 50
};
const output = await replicate.run("black-forest-labs/flux-fill-pro", { 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_acs**********************************
This is your API token. Keep it to yourself.
import replicate
Run black-forest-labs/flux-fill-pro using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"black-forest-labs/flux-fill-pro",
input={
"guidance": 60,
"image": "https://replicate.delivery/pbxt/N5rQeSTvbjlApLOqeYZLyENUsuvQCuLmxVmRU5QyTYNGXB7A/bf43e827cbe61cde0b5c4516281ef1e4.jpeg",
"outpaint": "Bottom outpaint",
"output_format": "jpg",
"prompt": "Simple, minimalistic, smooth, natural, seamless background, just simple colors and textures, pure background, same color palette, all colors uniform with original image, smooth, simplistic",
"prompt_upsampling": False,
"safety_tolerance": 2,
"seed": 0,
"steps": 50
}
)
# 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_acs**********************************
This is your API token. Keep it to yourself.
Run black-forest-labs/flux-fill-pro 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": {
"guidance": 60,
"image": "https://replicate.delivery/pbxt/N5rQeSTvbjlApLOqeYZLyENUsuvQCuLmxVmRU5QyTYNGXB7A/bf43e827cbe61cde0b5c4516281ef1e4.jpeg",
"outpaint": "Bottom outpaint",
"output_format": "jpg",
"prompt": "Simple, minimalistic, smooth, natural, seamless background, just simple colors and textures, pure background, same color palette, all colors uniform with original image, smooth, simplistic",
"prompt_upsampling": false,
"safety_tolerance": 2,
"seed": 0,
"steps": 50
}
}' \
https://api.replicate.com/v1/models/black-forest-labs/flux-fill-pro/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "ccjb1tbmk5rme0cq3hzvfh5wh0",
"model": "black-forest-labs/flux-fill-pro",
"version": "hidden",
"input": {
"guidance": 60,
"image": "https://replicate.delivery/pbxt/N5rQeSTvbjlApLOqeYZLyENUsuvQCuLmxVmRU5QyTYNGXB7A/bf43e827cbe61cde0b5c4516281ef1e4.jpeg",
"outpaint": "Bottom outpaint",
"output_format": "jpg",
"prompt": "Simple, minimalistic, smooth, natural, seamless background, just simple colors and textures, pure background, same color palette, all colors uniform with original image, smooth, simplistic",
"prompt_upsampling": false,
"safety_tolerance": 2,
"seed": 0,
"steps": 50
},
"logs": "Preparing prediction...\nChecking mask\nImage size: 18.9KB\nUsing seed: 4714\nCreating prediction...\nGenerating image...\nGenerated image in 9.2sec\nDownloading output...\nDownloaded image in 0.05sec",
"output": "https://replicate.delivery/xezq/owc55mviluaPFloe4bzPodem6Q7gnhpdeQup4ih8ZpnqkEjpA/tmp4ec_ei48.jpg",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-05-29T14:43:24.441Z",
"started_at": "2025-05-29T14:43:24.446581Z",
"completed_at": "2025-05-29T14:43:33.836969Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/ccjb1tbmk5rme0cq3hzvfh5wh0/cancel",
"get": "https://api.replicate.com/v1/predictions/ccjb1tbmk5rme0cq3hzvfh5wh0",
"stream": "https://stream.replicate.com/v1/files/bcwr-n3nz2cbxrawbl3mdtk2h77fxdjqrkvunlhcenfz54uo5binctrfa",
"web": "https://replicate.com/p/ccjb1tbmk5rme0cq3hzvfh5wh0"
},
"metrics": {
"image_count": 1,
"predict_time": 9.390387839,
"total_time": 9.395969
}
}
