Flux Fill Pro

Professional inpainting and outpainting model with state-of-the-art performance. Edit or extend images with natural, seamless results.

~23.06s
$0.063 per generation
 1import requests
 2import json
 3
 4url = "https://api.segmind.com/v1/flux-fill-pro"
 5headers = {
 6    "x-api-key": "YOUR_API_KEY",
 7    "Content-Type": "application/json"
 8}
 9
10data = {
11    "mask": "https://segmind-sd-models.s3.us-east-1.amazonaws.com/display_images/flux-tools/flux-fill-pro-mask.jpeg",
12    "seed": 965222,
13    "image": "https://segmind-sd-models.s3.us-east-1.amazonaws.com/display_images/flux-tools/flux-fill-pro-ip.jpg",
14    "steps": 50,
15    "prompt": "flower pot on the table",
16    "guidance": 3,
17    "output_format": "jpg",
18    "safety_tolerance": 2,
19    "prompt_upsampling": false
20}
21
22response = requests.post(url, headers=headers, json=data)
23
24if response.status_code == 200:
25    result = response.json()
26    print(json.dumps(result, indent=2))
27else:
28    print(f"Error: {response.status_code}")
29    print(response.text)

API Endpoint

POSThttps://api.segmind.com/v1/flux-fill-pro

Parameters

imagerequired
string (uri)

The image to inpaint. Can contain an alpha mask. Must be jpeg, png, or webp.

Default: "https://segmind-sd-models.s3.us-east-1.amazonaws.com/display_images/flux-tools/flux-fill-pro-ip.jpg"
maskrequired
string (uri)

A black-and-white image that describes the part of the image to inpaint. Black areas will be preserved while white areas will be inpainted. Must have the same size as image. Optional if you provide an alpha mask in the original image. Must be jpeg, png, or webp.

promptrequired
string

Text prompt for image generation

Default: "flower pot on the table"
guidanceoptional
number

Controls the balance between adherence to the text prompt and image quality/diversity. Higher values make the output more closely match the prompt but may reduce overall image quality. Lower values allow for more creative freedom but might produce results less relevant to the prompt.

Default: 3Range: 2 - 5
output_formatoptional
string

Format of the output images.

Default: "jpg"
Allowed values :
"jpg""png"
prompt_upsamplingoptional
boolean

Automatically modify the prompt for more creative generation

Default: false
safety_toleranceoptional
integer

Safety tolerance, 1 is most strict and 6 is most permissive

Default: 2Range: 1 - 6
seedoptional
integer

Random seed. Set for reproducible generation

Default: 965222
stepsoptional
integer

Number of diffusion steps. Higher values yield finer details but increase processing time.

Default: 50Range: 1 - 50

Response Type

Returns: Image

Common Error Codes

The API returns standard HTTP status codes. Detailed error messages are provided in the response body.

400

Bad Request

Invalid parameters or request format

401

Unauthorized

Missing or invalid API key

403

Forbidden

Insufficient permissions

404

Not Found

Model or endpoint not found

406

Insufficient Credits

Not enough credits to process request

429

Rate Limited

Too many requests

500

Server Error

Internal server error

502

Bad Gateway

Service temporarily unavailable

504

Timeout

Request timed out