The format
A prompt is your instruction, a space, then a JSON array. Each item:
| Key | Meaning |
|---|---|
id | Name you use in the instruction as <id> |
from | "ref_image_0" for something already in the input image, null for a new element |
src_bbox | Where it is now — null for new elements |
tgt_bbox | Where it should be: [y0, x0, y1, x1], 0–1000 from the top-left |
desc | A clear description of the element |
Three kinds of box: new (generated at the target), move (source → target), and anchor (source = target, keep it as is). The input image is referred to as <ref_image_0>.
Example: place new elements
A cozy reading corner with a green armchair <chair_1> on the left and a tall floor lamp <lamp_1> on the right, warm evening light. [{"id":"chair_1","from":null,"src_bbox":null,"tgt_bbox":[400,50,950,500],"desc":"A green velvet armchair."},{"id":"lamp_1","from":null,"src_bbox":null,"tgt_bbox":[100,700,950,850],"desc":"A tall brass floor lamp with a cream shade."}]
Example: move one thing, keep the rest
In <ref_image_0>, move the coffee cup <cup_1> to the right side of the table and keep the laptop <laptop_1> exactly where it is. [{"id":"cup_1","from":"ref_image_0","src_bbox":[520,120,700,280],"tgt_bbox":[520,700,700,860],"desc":"A white ceramic coffee cup."},{"id":"laptop_1","from":"ref_image_0","src_bbox":[300,300,750,680],"tgt_bbox":[300,300,750,680],"desc":"An open silver laptop."}]
Tips
- Give a box to everything that must not change (anchors) — not only to what you edit.
- Write specific
desctext: material, color, size. - Use a move box only when you know both where the element is and where it should go.
- Boxes guide placement and scale; they are not hard masks. Elements can spill over, very small ones may not appear, and edits can touch nearby pixels.
- Drawing boxes by hand is easier in the official Gradio demo in BFL's GitHub repo or the Hugging Face Space.
The format is documented by BFL for FLUX 3 Image, and FLUX 3 Image Klein keeps the same bounding-box feature. Our examples are illustrations, not BFL's.