Flux Fill Pro
Professional inpainting and outpainting model with state-of-the-art performance. Edit or extend images with natural, seamless results.
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) 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
https://api.segmind.com/v1/flux-fill-proParameters
imagerequiredstring (uri)The image to inpaint. Can contain an alpha mask. Must be jpeg, png, or webp.
"https://segmind-sd-models.s3.us-east-1.amazonaws.com/display_images/flux-tools/flux-fill-pro-ip.jpg"maskrequiredstring (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.
promptrequiredstringText prompt for image generation
"flower pot on the table"guidanceoptionalnumberControls 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.
3Range: 2 - 5output_formatoptionalstringFormat of the output images.
"jpg""jpg""png"prompt_upsamplingoptionalbooleanAutomatically modify the prompt for more creative generation
falsesafety_toleranceoptionalintegerSafety tolerance, 1 is most strict and 6 is most permissive
2Range: 1 - 6seedoptionalintegerRandom seed. Set for reproducible generation
965222stepsoptionalintegerNumber of diffusion steps. Higher values yield finer details but increase processing time.
50Range: 1 - 50Response Type
Returns: Image
Common Error Codes
The API returns standard HTTP status codes. Detailed error messages are provided in the response body.
Bad Request
Invalid parameters or request format
Unauthorized
Missing or invalid API key
Forbidden
Insufficient permissions
Not Found
Model or endpoint not found
Insufficient Credits
Not enough credits to process request
Rate Limited
Too many requests
Server Error
Internal server error
Bad Gateway
Service temporarily unavailable
Timeout
Request timed out