FLUX Outpainting extends an image naturally in any direction, filling new regions with contextually coherent content in a single call. Useful for aspect-ratio changes, banner generation, social media reformatting, or giving a composition more room to breathe.
Example output
Drag the slider to compare the input image padded onto the target canvas (left) with the outpainted result (right). No prompt was used — the model extended the scene on its own.Endpoint
Submit an outpainting job:Quick start
The API uses an asynchronous workflow:Submit an outpainting request
POST your input image (base64) and the target canvas dimensions to the endpoint. The model extends the existing scene naturally — no prompt is needed.
Request parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
input_image | base64 string | Yes | Reference image to expand |
width | integer | Yes | Target canvas width in pixels (>=64). width × height must not exceed 4 MP |
height | integer | Yes | Target canvas height in pixels (>=64). width × height must not exceed 4 MP |
reference_offset_x | integer | No | Left offset (px) of the reference image’s top-left corner on the canvas. Negative values allowed. None = center horizontally |
reference_offset_y | integer | No | Top offset (px) of the reference image’s top-left corner on the canvas. Negative values allowed. None = center vertically |
auto_crop | boolean | No | If true, crop the reference image to the canvas bounds when it extends beyond the edges. Defaults to false (out-of-bounds placements return 422) |
output_format | string | No | png (default) or jpeg |
Maximum canvas size: 4 MP. The target canvas area (
width × height) cannot exceed 4 megapixels (4,194,304 pixels). You’re free to choose any aspect ratio within that budget — for example 2048 × 2048, 2730 × 1536 (16:9), or 1024 × 4096 — as long as the two dimensions multiplied together stay at or below 4 MP. Requests above this limit return 422.Image placement
reference_offset_x and reference_offset_y set the top-left corner of the reference image on the output canvas. Drag the reference below to see how the offsets relate to the canvas:
You have two options for placing the reference image on the output canvas:
- Centered (default) — provide the image, set
widthandheight, and leavereference_offset_x/reference_offset_yasNone. The image is centered automatically. - Custom position — set
reference_offset_xandreference_offset_yto control exactly where the top-left corner of the reference image lands on the canvas. Negative values are allowed; if any part of the reference falls outside the canvas, either setauto_crop: trueor the request will return422.
Response format
Initial response
Polling response (success)
status is "Ready", use result.sample.
Tips for best results
- The model extends the existing scene naturally. The endpoint is tuned to continue the input image’s content, lighting, and composition on its own.
- The model was trained on green, blue, and magenta fill colors and performs best with those internally — no caller action needed; the server handles fill colors automatically.
- Keep total output dimensions reasonable. The canvas area (
width × height) is capped at 4 MP, and very large canvases or extreme aspect ratios may reduce quality even within that limit.
Troubleshooting
403 Forbidden— your API key is missing or your project doesn’t have access to this endpoint.422/ validation errors — check base64 encoding and thatwidth/heightare present, at least64, and that their product (width × height) does not exceed 4 MP. The endpoint rejects unknown fields: usereference_offset_x/reference_offset_y(not the olderbbox_x1/bbox_y1).- Visible seams — give the model more canvas room around the reference image.

