FLUX 3 Image
Bounding boxes
Tell FLUX 3 where each element goes. Draw a box, describe what belongs in it, and the model composes the image around your layout. Edit the same way: change one box, and everything outside it stays as it was.
What you can do with boxes
Every image below was made or edited with FLUX 3 from a prompt that contains boxes. Hover or tap an edit to compare it with its source.Boxes need no extra parameter. They are written intoprompt as a JSON array,
next to a description of the image. This tutorial builds that prompt step by
step: first for a new image, then for an edit.[top, left, bottom, right] in integers from 0 to 1000,
measured from the top-left corner. [0, 0, 500, 500] is the top-left
quarter of the image, whatever its size or aspect ratio.Generate a layout
You’ll recreate the image below: a running figure, centered on a flat chartreuse background. It has two elements, so its layout prompt is short.Describe the image and name each element
<silhouette_1>. Use lowercase names
with a number, so you can add silhouette_2 later.Give each element a box and a description
bbox says where the element sits, and desc says
what it looks like. The background fills the frame, and the runner takes
the middle 70% of it.Join them in one prompt and send it
prompt, with the aspect ratio you designed the boxes for.runner.png and prints its path.Edit an image box by box
To edit, send the image as a reference and describe it with the same kind of element table. Each row now says where an element comes from and where it should end up, so the model knows what to keep, what to move, and what to make new.ref_image_0 is the first image in images; the second is ref_image_1.Move an element
This edit moves a crocheted knight up the cliff and leaves the rest of the scene alone.List the elements of the source image
Change only the rows you want to edit
src_bbox and tgt_bbox equal. Then
give the knight a new tgt_bbox:Write the edit as an instruction
<ref_image_0>, say what changes, and name what
stays the same:Send the image and the prompt
images, and join the instruction and rows into
prompt as before. This uses generate() from the layout example:aspect_ratio defaults to auto, which keeps the shape of the first
reference.Replace or recolor
To change what an element looks like, make its row a New row and describe the result indesc. Several New rows in one request change several
elements at once:Remove an element
Settgt_bbox to null and say in the instruction what to remove. The
model fills the area with what was behind the element:Format
Write a description using<id> to name each element, then append a JSON
array of rows. This all goes in prompt, with no separate box parameter.Every box is [top, left, bottom, right], in integers from 0 to 1000.
For example, [0, 0, 500, 500] covers the top-left quarter of the image.Examples
More layouts and edits from the FLUX 3 launch. Choose an example, inspect its boxes, and copy the request body. Boxes guide placement; they are not clipping masks.- Generate
- Edit
Tips and limits
Boxes guide, they don't clip
Keep the aspect ratio
Give text its own box
desc, such as text reading "Sauna".
