---
title: Bounding boxes — FLUX 3.1 Image | Runware Docs
url: https://runware.ai/docs/models/bfl-flux-3-1-image/guides/bounding-boxes
description: "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](https://runware.ai/docs/models/bfl-flux-3-1-image/guides/bounding-boxes#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 black gym duffel bag, a matte black water bottle and a pair of black and lime training gloves arranged on the right of a concrete floor, with the left third of the frame empty](https://runware.ai/docs/assets/hero.DHYPP_y7_Z2jXSwm.jpg)

> **Prompt**: 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.

```json
[
  { "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.

> [!NOTE]
> `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](https://runware.ai/docs/models/bfl-flux-3-1-image/guides/bounding-boxes#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 white wireless earbuds case lying flat with two earbuds beside it in the lower left of a pale blue field, wider than it is tall](https://runware.ai/docs/assets/grid.BEvq4cl__r3Miq.jpg)

*One region at \[600, 80, 850, 500\]*

> **Prompt**: 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.

```json
[
  { "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.

> [!NOTE]
> 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](https://runware.ai/docs/models/bfl-flux-3-1-image/guides/bounding-boxes#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 sage walls, a striped single bed, a white bookshelf and a round road map rug arranged by the model](https://runware.ai/docs/assets/layout-prose.CGJfjwgh_nSlbb.jpg)

*Prose only*

> **Prompt**: 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.

![The same bedroom with the bookshelf against the left wall, the striped bed on the right and the road map rug across the foreground](https://runware.ai/docs/assets/layout-boxed.DVZvmbIi_1ttsfU.jpg)

*Three regions*

> **Prompt**: 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.

```json
[
  { "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**.

**TypeScript**:

```typescript
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'
      }
    ]
  }
})
```

**Python**:

```python
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**:

```bash
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"
          }
        ]
      }
    }
  ]'
```

**CLI**:

```bash
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"
```

**JSON**:

```json
{
  "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"
      }
    ]
  }
}
```

### [Adding to an existing image](https://runware.ai/docs/models/bfl-flux-3-1-image/guides/bounding-boxes#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.

**Source**:

![A bathroom vanity with a white quartz countertop, a round basin with a brass tap and a round mirror on a sage green tiled wall, the countertop bare either side](https://runware.ai/docs/assets/source-vanity.ejbHGIH4_ZP4IIH.jpg)

> **Prompt**: A bathroom vanity with a white quartz countertop and a single round white basin with a brushed brass tap in the center, a large round mirror on the sage green tiled wall above it, and the countertop bare on both sides of the basin. Soft daylight from a window out of frame on the left. Straight-on shot at countertop height, 35mm lens, the vanity filling the width of the frame. Photoreal bathroom interior photography, fresh green and white palette.

**Two elements added**:

![The same vanity with a stack of folded white towels on the left of the countertop and a small trailing plant in a white pot on the right](https://runware.ai/docs/assets/edit-add.BjUIoVXf_1BFfQX.jpg)

> **Prompt**: 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.

```json
[
  { "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.

**TypeScript**:

```typescript
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'
      }
    ]
  }
})
```

**Python**:

```python
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**:

```bash
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"
          }
        ]
      }
    }
  ]'
```

**CLI**:

```bash
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"
```

**JSON**:

```json
{
  "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"
      }
    ]
  }
}
```

### [Moving an element](https://runware.ai/docs/models/bfl-flux-3-1-image/guides/bounding-boxes#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 pale oak dining table with a vase of white tulips at the left end, a glass carafe and two tumblers in the middle and the right end bare](https://runware.ai/docs/assets/source-dining.DYMHx9zY_xW6DV.jpg)

*Source*

> **Prompt**: 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.

![The same table with the vase of tulips now at the right end and bare oak at the left end](https://runware.ai/docs/assets/edit-move.DDRrGSzF_24Tpnx.jpg)

*Moved to the right end*

> **Prompt**: 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.

```json
[
  { "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](https://runware.ai/docs/models/bfl-flux-3-1-image/guides/bounding-boxes#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.

![The walnut sideboard against the green wall with the fluted ceramic table lamp now standing on its right half under warm evening light](https://runware.ai/docs/assets/edit-product.DaiZbRWR_1x6pkW.jpg)

> **Prompt**: 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 wall with a framed abstract print above its left half and its right half bare](https://runware.ai/docs/assets/source-sideboard.D7FWADZF_2rwGYD.jpg)

> **Prompt**: 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 table lamp with a fluted white ceramic base and a pleated linen shade on a white background](https://runware.ai/docs/assets/ref-lamp.CmGwNkGg_Z1O7siy.jpg)

> **Prompt**: 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.

```json
[
  { "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.

> [!WARNING]
> `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.

**TypeScript**:

```typescript
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'
      }
    ]
  }
})
```

**Python**:

```python
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**:

```bash
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"
          }
        ]
      }
    }
  ]'
```

**CLI**:

```bash
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"
```

**JSON**:

```json
{
  "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"
      }
    ]
  }
}
```

### [Removing an element](https://runware.ai/docs/models/bfl-flux-3-1-image/guides/bounding-boxes#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.

**Source**:

![The oak dining table with the vase of tulips, the glass carafe and the two tumblers](https://runware.ai/docs/assets/source-dining.DYMHx9zY_xW6DV.jpg)

> **Prompt**: 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.

**Removed**:

![The same table with the carafe and tumblers gone and bare oak in the middle](https://runware.ai/docs/assets/edit-remove.D5y_Rh8Z_Z1KneeQ.jpg)

> **Prompt**: Remove <carafe_1> and leave bare oak where it stood. Keep the vase of tulips, the wall, the framing and the lighting unchanged.

```json
[
  { "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](https://runware.ai/docs/models/bfl-flux-3-1-image/guides/bounding-boxes#tips-for-best-results)

1. **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.
    
2. **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.
    
3. **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`.
    
4. **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.
    
5. **Point with a source box when the frame holds look-alikes.** Position picks one of two identical objects where a description cannot.
    
6. **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`.
    
7. **Batch regions in one request.** Several additions, moves or removals in one pass rebuild the untouched part of the frame once.
    
8. **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.