FLUX 3.1 Image
Bounding boxes
Pass 1 to 32 entries in bounding_boxes to place subjects and headlines in a layout, or to move, replace, and remove objects in an existing image.
id (letters, digits, and _, starting with a letter), [y_min, x_min, y_max, x_max] coordinates from 0 to 1, and an optional desc. Reference each box inside prompt in angle brackets (<title_1>, <arch_1>):Python
Box Studio
Try drawing boxes on a preset, a blank canvas, or your own image (files stay in your browser) to generate a request payload:Edit box by box
Whenimages is set, use from, src_bbox, and tgt_bbox instead of bbox. src_bbox uses the input image (ref_image_0 for images[0], ref_image_1 for images[1]) and tgt_bbox uses the output frame:Omit
src_bbox when from is "target", since sending both returns HTTP 422.Localize a layout
Reuse the text boxes from a layout generation to swap titles, dates, and venues across languages while anchoring the terracotta arch (arch_1) in place:Full Python script: generate and localize
Full Python script: generate and localize
Both steps use the
generate() helper:Python
Tips and helpers
- Rough proportions are enough; give each box a shape that broadly fits the subject so the model has room to compose naturally.
- Give every headline or date line its own box and quote the exact wording inside
descso letters stay crisp inside their own region without overlapping adjacent artwork. - Send the
aspect_ratio(ormatch_first_image) that your boxes were authored for, because coordinates scale with the output frame. - Boxes guide layout and placement rather than locking pixels. Use a painted mask when you need pixels outside the edited region restored from
images[0].
[y_min, x_min, y_max, x_max]:Python
Keep exploring
Edit and control
Compare instructions, painted masks, reference images, and boxes on one source photo.
API reference
Full request schema, field constraints, and response codes.
Overview
Quickstart client, sizing options, 4K zoom inspector, and web grounding.

