ApiframeApiframe Docs
Image Editing

Flux Fill Pro

Inpaint with a mask or outpaint to extend the canvas.

Use in Apiframe Studio

POST /v2/images/editmodel: "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-white mask image (white = repaint, black = keep).
  • mode: "outpaint" — Extend the canvas. Requires an outpaint preset (e.g. "Zoom out 1.5x", "Right outpaint"); ignores mask.

See Image Editing overview for common request fields, response format, and error codes.

Model-specific parameters

ParameterTypeDescription
fluxFillParams.imagestringSource image URL.
fluxFillParams.promptstringDescription of what should appear in the edited area (1–2,000 chars).
fluxFillParams.modestring"inpaint" or "outpaint".
fluxFillParams.maskstringRequired for inpaint. Black-and-white mask URL. White pixels are repainted, black pixels are kept.
fluxFillParams.outpaintstringRequired for outpaint. One of: "Zoom out 1.5x", "Zoom out 2x", "Make square", "Left outpaint", "Right outpaint", "Top outpaint", "Bottom outpaint".
fluxFillParams.stepsintegerDiffusion steps (1–50, default 50).
fluxFillParams.guidancenumberPrompt-vs-quality balance (2–5, default 3).
fluxFillParams.safety_toleranceintegerSafety strictness (1 = strictest, 6 = most permissive). Default 2.
fluxFillParams.output_formatstringOutput container. Values: "jpg", "png".
fluxFillParams.seedintegerReproducibility seed.
fluxFillParams.prompt_upsamplingbooleanAuto-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

On this page