FLUX 3.1 Image

FLUX 3.1 Image is Black Forest Labs' image generation and editing model, built for speed at every size from 1 MP up to native 4K. It keeps people and objects consistent across multiple references, edits locally through masks and bounding boxes while leaving the rest of the image untouched, and changes or translates text in its original lettering. It suits high-volume work such as product catalogs, virtual try-on, storyboards and key art.

Complete technical specification for integration
Ready-to-use code snippets for common workflows
Step-by-step tutorials for advanced use cases
← All GuidesBounding boxes
How to place, add, move and remove elements by region with FLUX 3.1 Image: reading the 0 to 1000 grid, laying out a frame and editing an image box by box.
Introduction
A prompt is good at saying what a frame holds and weak at saying where it goes. "A water bottle to the right of the bag" is one more clause for the model to weigh, and the bottle lands somewhere new on every run. A bounding box swaps that clause for a coordinate the object is placed at.
settings.boundingBoxes takes up to 32 regions per request. Each region has an id that is unique within the request, a targetBox for where the element sits in the output, and a description of what goes there. The floor, the wall and the light stay in the prompt, and every object gets a region of its own. The prompt refers to a region by its id in angle brackets, such as <bag_1>, which ties that part of the sentence to that box.

A fitness brand website hero on a smooth polished concrete floor against a plain charcoal wall, soft directional light from the right, soft contact shadows under every object. The frame holds <bag_1>, <bottle_1> and <gloves_1>, and the left third of the frame is empty concrete and wall with nothing in it. Photoreal sports product photography, cool neutral palette.
[
{ "id": "bag_1", "targetBox": [380, 360, 860, 690], "description": "a black nylon gym duffel bag with a lime green zip pull, lying on its side" },
{ "id": "bottle_1", "targetBox": [200, 720, 860, 810], "description": "a matte black stainless steel water bottle with a carry loop lid, standing upright" },
{ "id": "gloves_1", "targetBox": [700, 830, 930, 970], "description": "a pair of black and lime green training gloves lying flat, one on top of the other" }
]The regions stay in the right two thirds, and the prompt asks for the left third to stay empty, so the banner keeps room for a headline. This guide covers the grid the coordinates live on, laying out a frame from nothing, adding new elements to an existing image, moving one, bringing a product in from a second reference, and removing an element.
settings.boundingBoxes has the same shape as on FLUX 3 Image, so a box layout written for FLUX 3 Image works here unchanged.
The coordinate grid
A box is four integers, [top, left, bottom, right], on a grid that runs 0 to 1000 down and across the output, whatever its pixel size. The vertical coordinate comes first, which is the reverse of the x, y order most canvas and drawing libraries hand you.

A flat overhead product layout on a seamless pale blue field, soft even light. The only object in the frame is <earbuds_1>. Photoreal consumer electronics photography, cool pastel palette.
[
{ "id": "earbuds_1", "targetBox": [600, 80, 850, 500], "description": "a white wireless earbuds charging case lying flat with its lid closed, the two earbuds resting beside it" }
]Read in order, the box starts 60% of the way down and 8% across, and ends 85% down and halfway across, which puts the case low on the left and wider than it is tall. Read as x, y, the same four numbers would stand it on end in the upper right. Render one lopsided box like this when you wire boxes into a UI, and a mirrored result tells you the axes are swapped before a real layout depends on them.
The grid is relative to the frame, so a layout written once holds at every size. The same numbers mark the same part of the picture at 1 MP and at 4K, which means you can block a layout on cheap drafts and render the final at delivery size.
Each axis runs 0 to 1000 on its own, so the grid stretches with the canvas. A box that is square in grid units is square on a 1:1 output and wide on a 16:9 one. Set the boxes against the shape you will ship.
Laying out a frame
Without references, a region only places an element: targetBox says where it goes and description says what it is. referenceIndex and sourceBox point into a reference image, so a request without one rejects them.

A child's bedroom with pale sage walls and a light oak floor, soft daylight from a window out of frame on the left. The room holds a single bed with a mustard and white striped duvet, a tall white bookshelf filled with picture books and soft toys, and a round play rug printed with a map of roads. Wide shot at standing height, 24mm lens. Photoreal interior photography, soft pastel palette.

A child's bedroom with pale sage walls and a light oak floor, soft daylight from a window out of frame on the left. The room holds <bed_1>, <shelf_1> and <rug_1>. Wide shot at standing height, 24mm lens. Photoreal interior photography, soft pastel palette.
[
{ "id": "shelf_1", "targetBox": [100, 50, 780, 270], "description": "a tall white bookshelf filled with picture books and soft toys" },
{ "id": "bed_1", "targetBox": [400, 500, 880, 960], "description": "a single bed with a mustard and white striped duvet, headboard against the wall" },
{ "id": "rug_1", "targetBox": [780, 180, 970, 700], "description": "a round play rug printed with a map of roads, lying flat on the floor" }
]Both prompts describe the same room, and only the second pins the floor plan. It names the three objects by their ids and moves their detail into the description of each region, so the sentence keeps the room and the boxes keep the layout.
That split is what a template needs. A listing set shot to one floor plan or a frame that keeps a corner free for a logo stops depending on which run you got.
import { createClient } from '@runware/sdk'
const client = await createClient({ apiKey: process.env.RUNWARE_API_KEY })
const [result] = await client.run({
model: 'bfl:flux@3.1-image',
positivePrompt: 'A child\'s bedroom with pale sage walls and a light oak floor, soft daylight from a window out of frame on the left. The room holds <bed_1>, <shelf_1> and <rug_1>. Wide shot at standing height, 24mm lens. Photoreal interior photography, soft pastel palette.',
width: 1360,
height: 768,
settings: {
boundingBoxes: [
{
id: 'shelf_1',
targetBox: [
100,
50,
780,
270
],
description: 'a tall white bookshelf filled with picture books and soft toys'
},
{
id: 'bed_1',
targetBox: [
400,
500,
880,
960
],
description: 'a single bed with a mustard and white striped duvet, headboard against the wall'
},
{
id: 'rug_1',
targetBox: [
780,
180,
970,
700
],
description: 'a round play rug printed with a map of roads, lying flat on the floor'
}
]
}
})import asyncio
import os
from runware import Runware
async def main():
async with Runware(api_key=os.environ["RUNWARE_API_KEY"]) as client:
results = await client.run({
"model": "bfl:flux@3.1-image",
"positivePrompt": "A child's bedroom with pale sage walls and a light oak floor, soft daylight from a window out of frame on the left. The room holds <bed_1>, <shelf_1> and <rug_1>. Wide shot at standing height, 24mm lens. Photoreal interior photography, soft pastel palette.",
"width": 1360,
"height": 768,
"settings": {
"boundingBoxes": [
{
"id": "shelf_1",
"targetBox": [
100,
50,
780,
270
],
"description": "a tall white bookshelf filled with picture books and soft toys"
},
{
"id": "bed_1",
"targetBox": [
400,
500,
880,
960
],
"description": "a single bed with a mustard and white striped duvet, headboard against the wall"
},
{
"id": "rug_1",
"targetBox": [
780,
180,
970,
700
],
"description": "a round play rug printed with a map of roads, lying flat on the floor"
}
]
}
})
asyncio.run(main())curl https://api.runware.ai/v1 \
-H "Authorization: Bearer $RUNWARE_API_KEY" \
-H "Content-Type: application/json" \
-d '[
{
"taskType": "imageInference",
"taskUUID": "3c7e1a92-5b4d-4f08-a6e2-9d1c8b7f0a35",
"model": "bfl:flux@3.1-image",
"positivePrompt": "A child'\''s bedroom with pale sage walls and a light oak floor, soft daylight from a window out of frame on the left. The room holds <bed_1>, <shelf_1> and <rug_1>. Wide shot at standing height, 24mm lens. Photoreal interior photography, soft pastel palette.",
"width": 1360,
"height": 768,
"settings": {
"boundingBoxes": [
{
"id": "shelf_1",
"targetBox": [
100,
50,
780,
270
],
"description": "a tall white bookshelf filled with picture books and soft toys"
},
{
"id": "bed_1",
"targetBox": [
400,
500,
880,
960
],
"description": "a single bed with a mustard and white striped duvet, headboard against the wall"
},
{
"id": "rug_1",
"targetBox": [
780,
180,
970,
700
],
"description": "a round play rug printed with a map of roads, lying flat on the floor"
}
]
}
}
]'runware run bfl:flux@3.1-image \
positivePrompt="A child's bedroom with pale sage walls and a light oak floor, soft daylight from a window out of frame on the left. The room holds <bed_1>, <shelf_1> and <rug_1>. Wide shot at standing height, 24mm lens. Photoreal interior photography, soft pastel palette." \
width=1360 \
height=768 \
settings.boundingBoxes.0.id=shelf_1 \
settings.boundingBoxes.0.targetBox.0=100 \
settings.boundingBoxes.0.targetBox.1=50 \
settings.boundingBoxes.0.targetBox.2=780 \
settings.boundingBoxes.0.targetBox.3=270 \
settings.boundingBoxes.0.description="a tall white bookshelf filled with picture books and soft toys" \
settings.boundingBoxes.1.id=bed_1 \
settings.boundingBoxes.1.targetBox.0=400 \
settings.boundingBoxes.1.targetBox.1=500 \
settings.boundingBoxes.1.targetBox.2=880 \
settings.boundingBoxes.1.targetBox.3=960 \
settings.boundingBoxes.1.description="a single bed with a mustard and white striped duvet, headboard against the wall" \
settings.boundingBoxes.2.id=rug_1 \
settings.boundingBoxes.2.targetBox.0=780 \
settings.boundingBoxes.2.targetBox.1=180 \
settings.boundingBoxes.2.targetBox.2=970 \
settings.boundingBoxes.2.targetBox.3=700 \
settings.boundingBoxes.2.description="a round play rug printed with a map of roads, lying flat on the floor"{
"taskType": "imageInference",
"taskUUID": "3c7e1a92-5b4d-4f08-a6e2-9d1c8b7f0a35",
"model": "bfl:flux@3.1-image",
"positivePrompt": "A child's bedroom with pale sage walls and a light oak floor, soft daylight from a window out of frame on the left. The room holds <bed_1>, <shelf_1> and <rug_1>. Wide shot at standing height, 24mm lens. Photoreal interior photography, soft pastel palette.",
"width": 1360,
"height": 768,
"settings": {
"boundingBoxes": [
{
"id": "shelf_1",
"targetBox": [
100,
50,
780,
270
],
"description": "a tall white bookshelf filled with picture books and soft toys"
},
{
"id": "bed_1",
"targetBox": [
400,
500,
880,
960
],
"description": "a single bed with a mustard and white striped duvet, headboard against the wall"
},
{
"id": "rug_1",
"targetBox": [
780,
180,
970,
700
],
"description": "a round play rug printed with a map of roads, lying flat on the floor"
}
]
}
}Response
{
"data": [
{
"taskType": "imageInference",
"taskUUID": "3c7e1a92-5b4d-4f08-a6e2-9d1c8b7f0a35",
"imageUUID": "8a2f6d14-0e9b-4c73-b5a1-6f4e2d9c7b08",
"imageURL": "https://im.runware.ai/image/os/a14d18/ws/2/ii/8a2f6d14-0e9b-4c73-b5a1-6f4e2d9c7b08.jpg"
}
]
}Adding to an existing image
With a reference attached, a region whose referenceIndex is null is a new element. It has no source, only a targetBox and a description, and the model builds the object into the scene at that spot.
[
{ "id": "towels_1", "referenceIndex": null, "targetBox": [650, 70, 800, 290], "description": "a neat stack of three folded white cotton hand towels" },
{ "id": "plant_1", "referenceIndex": null, "targetBox": [520, 720, 800, 890], "description": "a small trailing pothos in a matte white ceramic pot" }
]The bottom edge of each box sits on the countertop, because a box sets the footprint and the sentence sets the contact. The prompt adds "sitting flat on the quartz with a soft contact shadow", since the coordinates alone say nothing about how the towels meet the stone.
Both objects go in on one pass. Each region is independent, so batching the additions rebuilds the rest of the frame once, where a chain of single additions would redraw the mirror and the tiles on every pass.
import { createClient } from '@runware/sdk'
const client = await createClient({ apiKey: process.env.RUNWARE_API_KEY })
const [result] = await client.run({
model: 'bfl:flux@3.1-image',
positivePrompt: 'Add <towels_1> on the left of the countertop and <plant_1> on the right, each sitting flat on the quartz with a soft contact shadow. Keep the basin, the tap, the mirror, the tiles, the framing and the lighting unchanged.',
width: 1248,
height: 832,
inputs: {
referenceImages: [
'https://assets.runware.ai/guides/bfl-flux-3-1-image/bounding-boxes/source-vanity.jpg'
]
},
settings: {
boundingBoxes: [
{
id: 'towels_1',
referenceIndex: null,
targetBox: [
650,
70,
800,
290
],
description: 'a neat stack of three folded white cotton hand towels'
},
{
id: 'plant_1',
referenceIndex: null,
targetBox: [
520,
720,
800,
890
],
description: 'a small trailing pothos in a matte white ceramic pot'
}
]
}
})import asyncio
import os
from runware import Runware
async def main():
async with Runware(api_key=os.environ["RUNWARE_API_KEY"]) as client:
results = await client.run({
"model": "bfl:flux@3.1-image",
"positivePrompt": "Add <towels_1> on the left of the countertop and <plant_1> on the right, each sitting flat on the quartz with a soft contact shadow. Keep the basin, the tap, the mirror, the tiles, the framing and the lighting unchanged.",
"width": 1248,
"height": 832,
"inputs": {
"referenceImages": [
"https://assets.runware.ai/guides/bfl-flux-3-1-image/bounding-boxes/source-vanity.jpg"
]
},
"settings": {
"boundingBoxes": [
{
"id": "towels_1",
"referenceIndex": None,
"targetBox": [
650,
70,
800,
290
],
"description": "a neat stack of three folded white cotton hand towels"
},
{
"id": "plant_1",
"referenceIndex": None,
"targetBox": [
520,
720,
800,
890
],
"description": "a small trailing pothos in a matte white ceramic pot"
}
]
}
})
asyncio.run(main())curl https://api.runware.ai/v1 \
-H "Authorization: Bearer $RUNWARE_API_KEY" \
-H "Content-Type: application/json" \
-d '[
{
"taskType": "imageInference",
"taskUUID": "6e1b9d47-2a3c-4f85-8b0e-c5d7a2f91364",
"model": "bfl:flux@3.1-image",
"positivePrompt": "Add <towels_1> on the left of the countertop and <plant_1> on the right, each sitting flat on the quartz with a soft contact shadow. Keep the basin, the tap, the mirror, the tiles, the framing and the lighting unchanged.",
"width": 1248,
"height": 832,
"inputs": {
"referenceImages": [
"https://assets.runware.ai/guides/bfl-flux-3-1-image/bounding-boxes/source-vanity.jpg"
]
},
"settings": {
"boundingBoxes": [
{
"id": "towels_1",
"referenceIndex": null,
"targetBox": [
650,
70,
800,
290
],
"description": "a neat stack of three folded white cotton hand towels"
},
{
"id": "plant_1",
"referenceIndex": null,
"targetBox": [
520,
720,
800,
890
],
"description": "a small trailing pothos in a matte white ceramic pot"
}
]
}
}
]'runware run bfl:flux@3.1-image \
positivePrompt="Add <towels_1> on the left of the countertop and <plant_1> on the right, each sitting flat on the quartz with a soft contact shadow. Keep the basin, the tap, the mirror, the tiles, the framing and the lighting unchanged." \
width=1248 \
height=832 \
inputs.referenceImages.0=https://assets.runware.ai/guides/bfl-flux-3-1-image/bounding-boxes/source-vanity.jpg \
settings.boundingBoxes.0.id=towels_1 \
settings.boundingBoxes.0.referenceIndex=null \
settings.boundingBoxes.0.targetBox.0=650 \
settings.boundingBoxes.0.targetBox.1=70 \
settings.boundingBoxes.0.targetBox.2=800 \
settings.boundingBoxes.0.targetBox.3=290 \
settings.boundingBoxes.0.description="a neat stack of three folded white cotton hand towels" \
settings.boundingBoxes.1.id=plant_1 \
settings.boundingBoxes.1.referenceIndex=null \
settings.boundingBoxes.1.targetBox.0=520 \
settings.boundingBoxes.1.targetBox.1=720 \
settings.boundingBoxes.1.targetBox.2=800 \
settings.boundingBoxes.1.targetBox.3=890 \
settings.boundingBoxes.1.description="a small trailing pothos in a matte white ceramic pot"{
"taskType": "imageInference",
"taskUUID": "6e1b9d47-2a3c-4f85-8b0e-c5d7a2f91364",
"model": "bfl:flux@3.1-image",
"positivePrompt": "Add <towels_1> on the left of the countertop and <plant_1> on the right, each sitting flat on the quartz with a soft contact shadow. Keep the basin, the tap, the mirror, the tiles, the framing and the lighting unchanged.",
"width": 1248,
"height": 832,
"inputs": {
"referenceImages": [
"https://assets.runware.ai/guides/bfl-flux-3-1-image/bounding-boxes/source-vanity.jpg"
]
},
"settings": {
"boundingBoxes": [
{
"id": "towels_1",
"referenceIndex": null,
"targetBox": [
650,
70,
800,
290
],
"description": "a neat stack of three folded white cotton hand towels"
},
{
"id": "plant_1",
"referenceIndex": null,
"targetBox": [
520,
720,
800,
890
],
"description": "a small trailing pothos in a matte white ceramic pot"
}
]
}
}Response
{
"data": [
{
"taskType": "imageInference",
"taskUUID": "6e1b9d47-2a3c-4f85-8b0e-c5d7a2f91364",
"imageUUID": "d93c5a08-7f2e-4b61-9a4d-1e8b6c3f2a70",
"imageURL": "https://im.runware.ai/image/os/a14d18/ws/2/ii/d93c5a08-7f2e-4b61-9a4d-1e8b6c3f2a70.jpg"
}
]
}Moving an element
A region with a sourceBox points at an element that is already in a reference. referenceIndex picks the reference, sourceBox marks where the element sits in it, and targetBox marks where it lands. Different boxes move or resize it, and matching boxes keep it in place, which turns the region into a pointer for a restyle.

A long pale oak dining table against a white limewashed wall, a tall ceramic vase of white tulips at the left end, a glass carafe of water with two tumblers in the middle, and the right end of the table bare. Soft daylight from a window out of frame on the left, gentle shadows on the oak. Straight-on shot at table height, 35mm lens, the table running the full width of the frame. Photoreal hospitality interior photography, warm neutral palette.

Move <vase_1> to the right end of the table and leave bare oak where it stood. Keep the carafe, the tumblers, the wall, the framing and the lighting unchanged.
[
{ "id": "vase_1", "referenceIndex": 0, "sourceBox": [180, 70, 620, 260], "targetBox": [180, 740, 620, 930], "description": "the tall ceramic vase of white tulips" }
]The source box says which vase and the target box says where it goes, so the sentence only has to name the move and what fills the gap it leaves. "Leave bare oak where it stood" is the part a box cannot express: it knows the vase's old position and nothing about the table underneath.
A box picks an object by position rather than by description, which matters most when a frame holds two of the same thing. Two identical vases at either end of a table leave a sentence only position words to choose by, and a sourceBox turns those words into coordinates.
Bringing in a product from another reference
referenceIndex can point at any reference in the request, so a region can lift an object out of one image and stand it in another. That is how a product from a packshot lands at an exact spot in a room shot.

Use image 1 as the scene. Stand <lamp_1> on the bare right half of the sideboard, with a soft contact shadow where its base meets the walnut. Keep <lamp_1> exact, including its fluted ceramic base and its pleated linen shade. Match the warm evening light of image 1 falling on it from the right. Keep the sideboard, the framed print, the green wall and the framing unchanged.
- Image 1: the scene

A low walnut sideboard against a deep green painted wall in a living room, a large framed abstract print hanging above the left half of it, and the right half of the sideboard top completely bare. Warm evening light from a window out of frame on the right. Straight-on shot at sideboard height, 35mm lens, the sideboard filling the lower half of the frame. Photoreal interior photography, warm palette.
- Image 2: the lamp

A product packshot of a table lamp with a fluted white ceramic base and a pleated natural linen shade, standing upright and centered on a seamless white background. Even shadowless studio light, 50mm lens. Photoreal home decor e-commerce packshot, clean white palette.
[ { "id": "lamp_1", "referenceIndex": 1, "sourceBox": [90, 240, 915, 770], "targetBox": [170, 630, 560, 840], "description": "the table lamp with the fluted white ceramic base and the pleated linen shade" } ]
The prompt names image 1 as the scene, and putting the scene first in inputs.referenceImages also lets a resolution request take its shape from it. The lamp is the second reference, so its region carries referenceIndex: 1 and a sourceBox around the lamp in the packshot, and targetBox stands it on the bare half of the sideboard.
The prompt still does the relighting. A packshot carries the even light of the studio it was shot in, and "match the warm evening light of image 1" is what turns it into an object standing in that room.
referenceIndex counts from zero and the prompt counts from one. The scene is inputs.referenceImages[0], which the sentence calls "image 1", and the lamp is inputs.referenceImages[1], so its region says referenceIndex: 1. Getting this off by one builds the composite out of the wrong picture.
import { createClient } from '@runware/sdk'
const client = await createClient({ apiKey: process.env.RUNWARE_API_KEY })
const [result] = await client.run({
model: 'bfl:flux@3.1-image',
positivePrompt: 'Use image 1 as the scene. Stand <lamp_1> on the bare right half of the sideboard, with a soft contact shadow where its base meets the walnut. Keep <lamp_1> exact, including its fluted ceramic base and its pleated linen shade. Match the warm evening light of image 1 falling on it from the right. Keep the sideboard, the framed print, the green wall and the framing unchanged.',
width: 1248,
height: 832,
inputs: {
referenceImages: [
'https://assets.runware.ai/guides/bfl-flux-3-1-image/bounding-boxes/source-sideboard.jpg',
'https://assets.runware.ai/guides/bfl-flux-3-1-image/bounding-boxes/ref-lamp.jpg'
]
},
settings: {
boundingBoxes: [
{
id: 'lamp_1',
referenceIndex: 1,
sourceBox: [
90,
240,
915,
770
],
targetBox: [
170,
630,
560,
840
],
description: 'the table lamp with the fluted white ceramic base and the pleated linen shade'
}
]
}
})import asyncio
import os
from runware import Runware
async def main():
async with Runware(api_key=os.environ["RUNWARE_API_KEY"]) as client:
results = await client.run({
"model": "bfl:flux@3.1-image",
"positivePrompt": "Use image 1 as the scene. Stand <lamp_1> on the bare right half of the sideboard, with a soft contact shadow where its base meets the walnut. Keep <lamp_1> exact, including its fluted ceramic base and its pleated linen shade. Match the warm evening light of image 1 falling on it from the right. Keep the sideboard, the framed print, the green wall and the framing unchanged.",
"width": 1248,
"height": 832,
"inputs": {
"referenceImages": [
"https://assets.runware.ai/guides/bfl-flux-3-1-image/bounding-boxes/source-sideboard.jpg",
"https://assets.runware.ai/guides/bfl-flux-3-1-image/bounding-boxes/ref-lamp.jpg"
]
},
"settings": {
"boundingBoxes": [
{
"id": "lamp_1",
"referenceIndex": 1,
"sourceBox": [
90,
240,
915,
770
],
"targetBox": [
170,
630,
560,
840
],
"description": "the table lamp with the fluted white ceramic base and the pleated linen shade"
}
]
}
})
asyncio.run(main())curl https://api.runware.ai/v1 \
-H "Authorization: Bearer $RUNWARE_API_KEY" \
-H "Content-Type: application/json" \
-d '[
{
"taskType": "imageInference",
"taskUUID": "b5d2e8f1-4a9c-4e37-8c06-2f7a1b9d3e54",
"model": "bfl:flux@3.1-image",
"positivePrompt": "Use image 1 as the scene. Stand <lamp_1> on the bare right half of the sideboard, with a soft contact shadow where its base meets the walnut. Keep <lamp_1> exact, including its fluted ceramic base and its pleated linen shade. Match the warm evening light of image 1 falling on it from the right. Keep the sideboard, the framed print, the green wall and the framing unchanged.",
"width": 1248,
"height": 832,
"inputs": {
"referenceImages": [
"https://assets.runware.ai/guides/bfl-flux-3-1-image/bounding-boxes/source-sideboard.jpg",
"https://assets.runware.ai/guides/bfl-flux-3-1-image/bounding-boxes/ref-lamp.jpg"
]
},
"settings": {
"boundingBoxes": [
{
"id": "lamp_1",
"referenceIndex": 1,
"sourceBox": [
90,
240,
915,
770
],
"targetBox": [
170,
630,
560,
840
],
"description": "the table lamp with the fluted white ceramic base and the pleated linen shade"
}
]
}
}
]'runware run bfl:flux@3.1-image \
positivePrompt="Use image 1 as the scene. Stand <lamp_1> on the bare right half of the sideboard, with a soft contact shadow where its base meets the walnut. Keep <lamp_1> exact, including its fluted ceramic base and its pleated linen shade. Match the warm evening light of image 1 falling on it from the right. Keep the sideboard, the framed print, the green wall and the framing unchanged." \
width=1248 \
height=832 \
inputs.referenceImages.0=https://assets.runware.ai/guides/bfl-flux-3-1-image/bounding-boxes/source-sideboard.jpg \
inputs.referenceImages.1=https://assets.runware.ai/guides/bfl-flux-3-1-image/bounding-boxes/ref-lamp.jpg \
settings.boundingBoxes.0.id=lamp_1 \
settings.boundingBoxes.0.referenceIndex=1 \
settings.boundingBoxes.0.sourceBox.0=90 \
settings.boundingBoxes.0.sourceBox.1=240 \
settings.boundingBoxes.0.sourceBox.2=915 \
settings.boundingBoxes.0.sourceBox.3=770 \
settings.boundingBoxes.0.targetBox.0=170 \
settings.boundingBoxes.0.targetBox.1=630 \
settings.boundingBoxes.0.targetBox.2=560 \
settings.boundingBoxes.0.targetBox.3=840 \
settings.boundingBoxes.0.description="the table lamp with the fluted white ceramic base and the pleated linen shade"{
"taskType": "imageInference",
"taskUUID": "b5d2e8f1-4a9c-4e37-8c06-2f7a1b9d3e54",
"model": "bfl:flux@3.1-image",
"positivePrompt": "Use image 1 as the scene. Stand <lamp_1> on the bare right half of the sideboard, with a soft contact shadow where its base meets the walnut. Keep <lamp_1> exact, including its fluted ceramic base and its pleated linen shade. Match the warm evening light of image 1 falling on it from the right. Keep the sideboard, the framed print, the green wall and the framing unchanged.",
"width": 1248,
"height": 832,
"inputs": {
"referenceImages": [
"https://assets.runware.ai/guides/bfl-flux-3-1-image/bounding-boxes/source-sideboard.jpg",
"https://assets.runware.ai/guides/bfl-flux-3-1-image/bounding-boxes/ref-lamp.jpg"
]
},
"settings": {
"boundingBoxes": [
{
"id": "lamp_1",
"referenceIndex": 1,
"sourceBox": [
90,
240,
915,
770
],
"targetBox": [
170,
630,
560,
840
],
"description": "the table lamp with the fluted white ceramic base and the pleated linen shade"
}
]
}
}Response
{
"data": [
{
"taskType": "imageInference",
"taskUUID": "b5d2e8f1-4a9c-4e37-8c06-2f7a1b9d3e54",
"imageUUID": "4f8a1c6e-93b2-4d05-a7e1-8c2d5b0f6a93",
"imageURL": "https://im.runware.ai/image/os/a14d18/ws/2/ii/4f8a1c6e-93b2-4d05-a7e1-8c2d5b0f6a93.jpg"
}
]
}Removing an element
targetBox: null gives an element nowhere to land, which takes it out of the frame. The sourceBox still marks what goes, and the sentence names the surface that is left behind.
[
{ "id": "carafe_1", "referenceIndex": 0, "sourceBox": [360, 400, 620, 600], "targetBox": null, "description": "the glass carafe of water with the two tumblers" }
]One region can hold a group of objects when they go together. The carafe and both tumblers sit inside one source box, so a single region removes all three.
A removal needs something to remove from, so targetBox: null only works in an edit. A request without inputs.referenceImages rejects it, because every region there has to land somewhere.
Tips for best results
-
Write the box as top, left, bottom, right. Vertical first. A layout that comes back mirrored or rotated is the axis order, not the prompt.
-
Refer to each region by its id.
<vase_1>in the prompt points at one region, where "the vase" leaves the model to match the words to a box. -
Keep scene words in the prompt and object words in the regions. Light, surface and style belong to the sentence. What each object is belongs to its
description. -
Rest a new element's box on its surface. The bottom edge of the box is where the object meets the counter or the floor, and the prompt adds the contact shadow.
-
Point with a source box when the frame holds look-alikes. Position picks one of two identical objects where a description cannot.
-
Say which image is the scene. The prompt assigns that role, and the product's region points at its own image with a zero-based
referenceIndex. -
Batch regions in one request. Several additions, moves or removals in one pass rebuild the untouched part of the frame once.
-
Leave a margin at the frame edge. A box pressed against the border leaves no room for the shadow or the contact point, which is where a placed object stops looking photographed.


