Skip to main content

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.

Each box takes a unique 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

When images 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:
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 desc so letters stay crisp inside their own region without overlapping adjacent artwork.
  • Send the aspect_ratio (or match_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].
Convert pixel coordinates from an image into [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.