Flux Fill Dev
Open-weight inpainting model for editing and extending images. Guidance-distilled from FLUX.1 Fill Dev
1import requests
2import json
3
4url = "https://api.segmind.com/v1/flux-fill-dev"
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-dev-mask.png",
12 "seed": 985266,
13 "image": "https://segmind-sd-models.s3.us-east-1.amazonaws.com/display_images/flux-tools/flux-fill-dev-ip.png",
14 "prompt": "Green hair",
15 "guidance": 30,
16 "megapixels": "1",
17 "num_outputs": 1,
18 "output_format": "jpg",
19 "output_quality": 80,
20 "num_inference_steps": 28,
21 "disable_safety_checker": false
22}
23
24response = requests.post(url, headers=headers, json=data)
25
26if response.status_code == 200:
27 result = response.json()
28 print(json.dumps(result, indent=2))
29else:
30 print(f"Error: {response.status_code}")
31 print(response.text) 1import requests
2import json
3
4url = "https://api.segmind.com/v1/flux-fill-dev"
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-dev-mask.png",
12 "seed": 985266,
13 "image": "https://segmind-sd-models.s3.us-east-1.amazonaws.com/display_images/flux-tools/flux-fill-dev-ip.png",
14 "prompt": "Green hair",
15 "guidance": 30,
16 "megapixels": "1",
17 "num_outputs": 1,
18 "output_format": "jpg",
19 "output_quality": 80,
20 "num_inference_steps": 28,
21 "disable_safety_checker": false
22}
23
24response = requests.post(url, headers=headers, json=data)
25
26if response.status_code == 200:
27 result = response.json()
28 print(json.dumps(result, indent=2))
29else:
30 print(f"Error: {response.status_code}")
31 print(response.text)API Endpoint
https://api.segmind.com/v1/flux-fill-devParameters
imagerequiredstring (uri)The image to inpaint. Can contain alpha mask. If the image width or height are not multiples of 32, they will be scaled to the closest multiple of 32. If the image dimensions don't fit within 1440x1440, it will be scaled down to fit.
"https://segmind-sd-models.s3.us-east-1.amazonaws.com/display_images/flux-tools/flux-fill-dev-ip.png"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.
promptrequiredstringPrompt for generated image
"Green hair"disable_safety_checkeroptionalbooleanDisable safety checker for generated images.
falseguidanceoptionalnumberGuidance for generated image
30Range: 0 - 100megapixelsoptionalstringApproximate number of megapixels for generated image. Use match_input to match the size of the input (with an upper limit of 1440x1440 pixels)
"1""1""0.25""match_input"num_inference_stepsoptionalintegerNumber of denoising steps. Recommended range is 28-50, and lower number of steps produce lower quality outputs, faster.
28Range: 1 - 50num_outputsoptionalintegerNumber of outputs to generate
1Range: 1 - 4output_formatoptionalstringAn enumeration.
"jpg""webp""jpg""png"output_qualityoptionalintegerQuality when saving the output images, from 0 to 100. 100 is best quality, 0 is lowest quality. Not relevant for .png outputs
80Range: 0 - 100seedoptionalintegerRandom seed. Set for reproducible generation
985266Response 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