typetext
{
"guidance": 60,
"image": "https://replicate.delivery/pbxt/N5rNwEbBCwNIxZagS1e15sxO82Xn2dNrFZmo0jPRLtocZb4s/fwee-lip-cheek-blurry-pot-cover.webp",
"outpaint": "Zoom out 2x",
"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_4Td**********************************
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/N5rNwEbBCwNIxZagS1e15sxO82Xn2dNrFZmo0jPRLtocZb4s/fwee-lip-cheek-blurry-pot-cover.webp",
outpaint: "Zoom out 2x",
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_4Td**********************************
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/N5rNwEbBCwNIxZagS1e15sxO82Xn2dNrFZmo0jPRLtocZb4s/fwee-lip-cheek-blurry-pot-cover.webp",
"outpaint": "Zoom out 2x",
"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_4Td**********************************
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/N5rNwEbBCwNIxZagS1e15sxO82Xn2dNrFZmo0jPRLtocZb4s/fwee-lip-cheek-blurry-pot-cover.webp",
"outpaint": "Zoom out 2x",
"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": "wbd39qykc9rmc0cq3hy91nmd1m",
"model": "black-forest-labs/flux-fill-pro",
"version": "hidden",
"input": {
"guidance": 60,
"image": "https://replicate.delivery/pbxt/N5rNwEbBCwNIxZagS1e15sxO82Xn2dNrFZmo0jPRLtocZb4s/fwee-lip-cheek-blurry-pot-cover.webp",
"outpaint": "Zoom out 2x",
"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: 30.9KB\nUsing seed: 34916\nCreating prediction...\nGenerating image...\nGenerated image in 16.4sec\nDownloading output...\nDownloaded image in 0.06sec",
"output": "https://replicate.delivery/xezq/PFUe4zAeKMgT0EaB0owYV2TJne1loaRq7nb5THkXeZeHejYMF/tmprvqz7mt6.jpg",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-05-29T14:40:32.098Z",
"started_at": "2025-05-29T14:40:32.105542Z",
"completed_at": "2025-05-29T14:40:48.712717Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/wbd39qykc9rmc0cq3hy91nmd1m/cancel",
"get": "https://api.replicate.com/v1/predictions/wbd39qykc9rmc0cq3hy91nmd1m",
"stream": "https://stream.replicate.com/v1/files/bcwr-ipthveob7iodwx6hjdsmcxlqjsxgzjqobxruqtq45all3xfyhesq",
"web": "https://replicate.com/p/wbd39qykc9rmc0cq3hy91nmd1m"
},
"metrics": {
"image_count": 1,
"predict_time": 16.607174362,
"total_time": 16.614717
}
}
