Image Editing
Flux Fill Pro
Inpaint with a mask or outpaint to extend the canvas.
POST /v2/images/edit — model: "flux-fill-pro"
Black Forest Labs' Flux Fill Pro handles two distinct workflows behind a single endpoint, switched by the mode field:
mode: "inpaint"— Repaint a masked region. Requires a black-and-whitemaskimage (white = repaint, black = keep).mode: "outpaint"— Extend the canvas. Requires anoutpaintpreset (e.g."Zoom out 1.5x","Right outpaint"); ignoresmask.
See Image Editing overview for common request fields, response format, and error codes.
Model-specific parameters
| Parameter | Type | Description |
|---|---|---|
fluxFillParams.image | string | Source image URL. |
fluxFillParams.prompt | string | Description of what should appear in the edited area (1–2,000 chars). |
fluxFillParams.mode | string | "inpaint" or "outpaint". |
fluxFillParams.mask | string | Required for inpaint. Black-and-white mask URL. White pixels are repainted, black pixels are kept. |
fluxFillParams.outpaint | string | Required for outpaint. One of: "Zoom out 1.5x", "Zoom out 2x", "Make square", "Left outpaint", "Right outpaint", "Top outpaint", "Bottom outpaint". |
fluxFillParams.steps | integer | Diffusion steps (1–50, default 50). |
fluxFillParams.guidance | number | Prompt-vs-quality balance (2–5, default 3). |
fluxFillParams.safety_tolerance | integer | Safety strictness (1 = strictest, 6 = most permissive). Default 2. |
fluxFillParams.output_format | string | Output container. Values: "jpg", "png". |
fluxFillParams.seed | integer | Reproducibility seed. |
fluxFillParams.prompt_upsampling | boolean | Auto-rewrite the prompt for more creative output. |
Credit cost
9 credits per generation, in either mode.
Inpaint — repaint a masked region
curl -X POST https://api.apiframe.ai/v2/images/edit \
-H "X-API-Key: afk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"model": "flux-fill-pro",
"fluxFillParams": {
"image": "https://example.com/scene.jpg",
"mask": "https://example.com/scene-mask.png",
"mode": "inpaint",
"prompt": "a vintage red bicycle leaning against the wall"
}
}'import requests
response = requests.post(
"https://api.apiframe.ai/v2/images/edit",
headers={
"X-API-Key": "afk_your_api_key_here",
"Content-Type": "application/json",
},
json={
"model": "flux-fill-pro",
"fluxFillParams": {
"image": "https://example.com/scene.jpg",
"mask": "https://example.com/scene-mask.png",
"mode": "inpaint",
"prompt": "a vintage red bicycle leaning against the wall",
},
},
)
print(response.json())const response = await fetch("https://api.apiframe.ai/v2/images/edit", {
method: "POST",
headers: {
"X-API-Key": "afk_your_api_key_here",
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "flux-fill-pro",
fluxFillParams: {
image: "https://example.com/scene.jpg",
mask: "https://example.com/scene-mask.png",
mode: "inpaint",
prompt: "a vintage red bicycle leaning against the wall",
},
}),
});
console.log(await response.json());Outpaint — extend the canvas
curl -X POST https://api.apiframe.ai/v2/images/edit \
-H "X-API-Key: afk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"model": "flux-fill-pro",
"fluxFillParams": {
"image": "https://example.com/portrait.jpg",
"mode": "outpaint",
"outpaint": "Zoom out 1.5x",
"prompt": "extend the misty forest background naturally"
}
}'import requests
response = requests.post(
"https://api.apiframe.ai/v2/images/edit",
headers={
"X-API-Key": "afk_your_api_key_here",
"Content-Type": "application/json",
},
json={
"model": "flux-fill-pro",
"fluxFillParams": {
"image": "https://example.com/portrait.jpg",
"mode": "outpaint",
"outpaint": "Zoom out 1.5x",
"prompt": "extend the misty forest background naturally",
},
},
)
print(response.json())const response = await fetch("https://api.apiframe.ai/v2/images/edit", {
method: "POST",
headers: {
"X-API-Key": "afk_your_api_key_here",
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "flux-fill-pro",
fluxFillParams: {
image: "https://example.com/portrait.jpg",
mode: "outpaint",
outpaint: "Zoom out 1.5x",
prompt: "extend the misty forest background naturally",
},
}),
});
console.log(await response.json());Try it
POST
/v2/images/editTry it