Skip to main content
POST
Outpaint or extend an image

Authorizations

x-key
string
header
required

Body

application/json

Public contract for /v1/flux-tools/outpainting-v1.

input_image
string
required

Base64-encoded input (reference) image or HTTP(S) image URL.

width
integer
required

Target output width.

Required range: x >= 64
height
integer
required

Target output height.

Required range: x >= 64
auto_crop
boolean
default:false

If True, crop the input image to the canvas bounds when it extends beyond the edges. If False, an error is raised instead.

safety_tolerance
integer
default:2

Tolerance level for input and output moderation. Between 0 and 5, 0 being most strict, 5 being least strict. If you wish to increase the safety_tolerance beyond these levels please reach out to the team.

Required range: 0 <= x <= 5
output_format
enum<string> | null
default:png
Available options:
jpeg,
png,
webp
prompt
string | null

Experimental: optional text guidance for the outpainted region. The model may not strictly follow this prompt; the visual content of the input image is the primary signal. Leave unset for default behavior.

reference_offset_x
integer | null

Left offset (px) of the reference image's top-left corner on the output canvas. Negative values are allowed. None = center horizontally.

reference_offset_y
integer | null

Top offset (px) of the reference image's top-left corner on the output canvas. Negative values are allowed. None = center vertically.

mode
enum<string>
default:high

Quality/speed trade-off. 'high' (default): highest-fidelity results, recommended whenever fine detail, prompt adherence, or consistency with complex content in the source image matters; slower. 'fast': significantly faster and well-suited for naturally extending most scenes (landscapes, backgrounds, textures, products); may produce lower fidelity in the extended region than 'high'.

Available options:
high,
fast

Response

Successful Response

id
string
required
polling_url
string
required
cost
number | null

Cost in credits for this request

input_mp
number | null

Input megapixels (2 decimal places)

output_mp
number | null

Output megapixels (2 decimal places)