---
title: Region edits — Ideogram 4.5 Precise Edit | Runware Docs
url: https://runware.ai/docs/models/ideogram-4-5-precise-edit/guides/region-edits
description: How to edit one region of a large image with Ideogram 4.5 Precise Edit and settings.editRegion, so 4K and 8K sources come back at full resolution.
---
### [Introduction](https://runware.ai/docs/models/ideogram-4-5-precise-edit/guides/region-edits#introduction)

Precise Edit returns **at most 4,194,304 pixels**. A larger source is scaled down before the edit, so an 8K listing photo comes back at 2720 × 1530 even when the instruction only changes one picture on the wall.

`settings.editRegion` limits the edit to **one region of the source**. Everything outside that region comes back unchanged, and the output keeps the source's own dimensions, up to 67,108,864 pixels, such as 8192 × 8192.

**Source and region**:

![A bright living room with a light gray sofa under a framed ochre and blue abstract painting, a round oak coffee table on a cream rug, a white bookshelf on the right and a curtained window on the left, with the edit region drawn around the painting](https://runware.ai/docs/assets/source-living.t8ImDTQH_ZMkFCD.jpg)

> **Prompt**: Photorealistic real estate listing photograph of a bright Scandinavian living room. A light gray three-seat sofa stands against a plain white wall, with one large framed abstract painting in soft ochre and blue hung centered on the wall above it. A round oak coffee table on a cream wool rug sits in front of the sofa, a tall white bookshelf filled with books and small objects stands on the right, and a window with sheer white curtains is on the left. Wide straight-on shot at eye level with a 24mm lens, the sofa and the painting centered. Bright natural daylight, crisp detail.

**Result**:

![The same living room with a framed black and white photograph of a rocky coastline above the sofa in place of the painting](https://runware.ai/docs/assets/output-living-region.Buoq84N6_Z1huwHW.jpg)

> **Prompt**: Replace the framed abstract painting above the sofa with a framed black and white photograph of a rocky coastline, in the same frame and at the same size. Keep everything else in the image exactly the same.

The source is 7680 × 4320, and the box covers the painting with a margin of wall around it. The result comes back at **the full 7680 × 4320** with the coastline photograph in the frame, and everything outside the box, from the sofa to the bookshelf, is unchanged from the source.

This guide covers what a region keeps, drawing the box, fitting a region to a mask, the limits a box must meet and when to leave the region out.

### [What a region keeps](https://runware.ai/docs/models/ideogram-4-5-precise-edit/guides/region-edits#what-a-region-keeps)

Without a region, **the whole frame is scaled down**, not only the part the instruction changed. The same edit ran twice on the source above, once without `settings.editRegion` and once with the box from the hero. Both crops show the same patch of the bookshelf, which the instruction never touched.

![A close crop of a stack of books on the white shelf, soft, with the page edges and the lettering on the spines smeared](https://runware.ai/docs/assets/crop-living-full.DrggGJR2_1Hliwd.jpg)

*Without a region, from a 2720 × 1530 result*

> **Prompt**: Replace the framed abstract painting above the sofa with a framed black and white photograph of a rocky coastline, in the same frame and at the same size. Keep everything else in the image exactly the same.

![The same stack of books, sharp, with crisp page edges and clear lettering on the spines](https://runware.ai/docs/assets/crop-living-region.BYuh_5QA_Z2p5Wsk.jpg)

*With a region, from a 7680 × 4320 result*

> **Prompt**: Replace the framed abstract painting above the sofa with a framed black and white photograph of a rocky coastline, in the same frame and at the same size. Keep everything else in the image exactly the same.

The crop on the left is 170 pixels across and the one on the right is 480, the same stack of books at **a third of the resolution**. The page edges and the lettering on the spines are crisp on the right and smeared on the left.

The request is an ordinary edit with the box added under `settings`:

**TypeScript**:

```typescript
import { createClient } from '@runware/sdk'

const client = await createClient({ apiKey: process.env.RUNWARE_API_KEY })
await client.connect()

const [result] = await client.run({
  model: 'ideogram:4.5@precise-edit',
  positivePrompt: 'Replace the framed abstract painting above the sofa with a framed black and white photograph of a rocky coastline, in the same frame and at the same size. Keep everything else in the image exactly the same.',
  inputs: {
    seedImage: 'https://example.com/living-room-8k.jpg'
  },
  settings: {
    editRegion: [
      3168,
      704,
      4608,
      2368
    ]
  }
})
```

**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": "ideogram:4.5@precise-edit",
            "positivePrompt": "Replace the framed abstract painting above the sofa with a framed black and white photograph of a rocky coastline, in the same frame and at the same size. Keep everything else in the image exactly the same.",
            "inputs": {
                "seedImage": "https://example.com/living-room-8k.jpg"
            },
            "settings": {
                "editRegion": [
                    3168,
                    704,
                    4608,
                    2368
                ]
            }
        })

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": "8d2f4a61-5c3e-4b9a-a7f0-1e6c9b3d2a58",
      "model": "ideogram:4.5@precise-edit",
      "positivePrompt": "Replace the framed abstract painting above the sofa with a framed black and white photograph of a rocky coastline, in the same frame and at the same size. Keep everything else in the image exactly the same.",
      "inputs": {
        "seedImage": "https://example.com/living-room-8k.jpg"
      },
      "settings": {
        "editRegion": [
          3168,
          704,
          4608,
          2368
        ]
      }
    }
  ]'
```

**CLI**:

```bash
runware run ideogram:4.5@precise-edit \
  positivePrompt="Replace the framed abstract painting above the sofa with a framed black and white photograph of a rocky coastline, in the same frame and at the same size. Keep everything else in the image exactly the same." \
  inputs.seedImage=https://example.com/living-room-8k.jpg \
  settings.editRegion.0=3168 \
  settings.editRegion.1=704 \
  settings.editRegion.2=4608 \
  settings.editRegion.3=2368
```

**JSON**:

```json
{
  "taskType": "imageInference",
  "taskUUID": "8d2f4a61-5c3e-4b9a-a7f0-1e6c9b3d2a58",
  "model": "ideogram:4.5@precise-edit",
  "positivePrompt": "Replace the framed abstract painting above the sofa with a framed black and white photograph of a rocky coastline, in the same frame and at the same size. Keep everything else in the image exactly the same.",
  "inputs": {
    "seedImage": "https://example.com/living-room-8k.jpg"
  },
  "settings": {
    "editRegion": [
      3168,
      704,
      4608,
      2368
    ]
  }
}
```

### [Drawing the box](https://runware.ai/docs/models/ideogram-4-5-precise-edit/guides/region-edits#drawing-the-box)

The box is `[x1, y1, x2, y2]` in **pixels of the source**: the left and top edges, then the right and bottom edges. Take the coordinates from the full-size file, because a box measured on a 1920-pixel preview of an 8K photo lands in the wrong place.

A box is also **a hard boundary**. A mask guides the edit and the result can grow past it, but nothing outside the box can change. A box drawn too tight stops the edit in a straight line at its edge.

**Source and region**:

![A hotel room with a king bed and a teal velvet headboard on the left and a teal velvet armchair by a tall window on the right, with a narrow edit region drawn over the middle of the armchair](https://runware.ai/docs/assets/source-hotel.rEosw6tn_ZYbFMG.jpg)

> **Prompt**: Photorealistic hotel marketing photograph of a boutique hotel room. A king bed with crisp white linen and a deep teal velvet headboard stands on the left half of the room, and a single deep teal velvet armchair stands on the right, next to a floor-to-ceiling window, with a small round brass side table beside it. Warm oak floor, plain warm white walls. Wide straight-on shot at eye level with a 24mm lens. Soft daylight from the window, clean and calm.

**Narrow box**:

![The same hotel room with a vertical band through the middle of the armchair in mustard yellow velvet and both arms still teal, split along straight lines](https://runware.ai/docs/assets/output-hotel-narrow.B_OoJpZV_B9Bt3.jpg)

> **Prompt**: Change the upholstery of the velvet armchair by the window to mustard yellow velvet. Keep everything else in the image exactly the same.

**Source and region**:

![The same hotel room with an edit region drawn around the whole armchair and some floor around it](https://runware.ai/docs/assets/source-hotel.rEosw6tn_ZYbFMG.jpg)

> **Prompt**: Photorealistic hotel marketing photograph of a boutique hotel room. A king bed with crisp white linen and a deep teal velvet headboard stands on the left half of the room, and a single deep teal velvet armchair stands on the right, next to a floor-to-ceiling window, with a small round brass side table beside it. Warm oak floor, plain warm white walls. Wide straight-on shot at eye level with a 24mm lens. Soft daylight from the window, clean and calm.

**Box around the chair**:

![The same hotel room with the whole armchair in mustard yellow velvet and the teal headboard unchanged](https://runware.ai/docs/assets/output-hotel-whole.Ca0QfOJ1_1mcRDc.jpg)

> **Prompt**: Change the upholstery of the velvet armchair by the window to mustard yellow velvet. Keep everything else in the image exactly the same.

The narrow box covers only a band through the middle of the armchair, so the mustard velvet **stops in straight lines** at both edges of the box and the arms on either side stay teal. The second box takes in the whole chair with floor around it, and the chair comes back mustard from arm to arm while the teal headboard across the room is untouched.

So draw the box **around the whole object**, its shadow included, the same way you would paint a generous mask in [Masked edits](https://runware.ai/docs/models/ideogram-4-5-precise-edit/guides/masked-edits).

### [Fitting the region to a mask](https://runware.ai/docs/models/ideogram-4-5-precise-edit/guides/region-edits#fitting-the-region-to-a-mask)

When you already have a mask, set `settings.editRegion` to `auto` and Precise Edit **fits the region around the mask**, so there are no coordinates to work out. `auto` needs `inputs.maskImage`, and the mask works the way it always does, white over the part to change.

**Source and mask**:

![A frosted glass perfume bottle with a polished gold cap on a travertine block against a warm beige backdrop, with the masked area over the cap highlighted](https://runware.ai/docs/assets/source-packshot.DzYuQ-pu_1vyG2O.jpg)

> **Prompt**: Photorealistic product photograph for a print campaign: a frosted glass perfume bottle with a polished gold cap standing on a block of travertine stone, against a seamless warm beige backdrop. Straight-on shot with a 100mm lens at bottle height, the bottle upright in the middle of the frame with generous empty space on both sides. Soft diffused studio light from the left, gentle shadow to the right.

**Result**:

![The same perfume bottle on the travertine block with a matte black cap in place of the gold one](https://runware.ai/docs/assets/output-packshot.CCBcULcl_1j1bLJ.jpg)

> **Prompt**: Change the gold cap of the perfume bottle to a matte black cap of the same shape and size. Keep everything else in the image exactly the same.

The mask covers the cap and the region is fitted around it. The packshot comes back at **7680 × 4320, large enough for print**, with a matte black cap on the same bottle.

**TypeScript**:

```typescript
import { createClient } from '@runware/sdk'

const client = await createClient({ apiKey: process.env.RUNWARE_API_KEY })
await client.connect()

const [result] = await client.run({
  model: 'ideogram:4.5@precise-edit',
  positivePrompt: 'Change the gold cap of the perfume bottle to a matte black cap of the same shape and size. Keep everything else in the image exactly the same.',
  inputs: {
    seedImage: 'https://example.com/perfume-8k.jpg',
    maskImage: 'https://example.com/perfume-cap-mask.png'
  },
  settings: {
    editRegion: 'auto'
  }
})
```

**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": "ideogram:4.5@precise-edit",
            "positivePrompt": "Change the gold cap of the perfume bottle to a matte black cap of the same shape and size. Keep everything else in the image exactly the same.",
            "inputs": {
                "seedImage": "https://example.com/perfume-8k.jpg",
                "maskImage": "https://example.com/perfume-cap-mask.png"
            },
            "settings": {
                "editRegion": "auto"
            }
        })

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": "4b9e2c17-8f3a-4d06-b5e1-9a7c3f2d6e84",
      "model": "ideogram:4.5@precise-edit",
      "positivePrompt": "Change the gold cap of the perfume bottle to a matte black cap of the same shape and size. Keep everything else in the image exactly the same.",
      "inputs": {
        "seedImage": "https://example.com/perfume-8k.jpg",
        "maskImage": "https://example.com/perfume-cap-mask.png"
      },
      "settings": {
        "editRegion": "auto"
      }
    }
  ]'
```

**CLI**:

```bash
runware run ideogram:4.5@precise-edit \
  positivePrompt="Change the gold cap of the perfume bottle to a matte black cap of the same shape and size. Keep everything else in the image exactly the same." \
  inputs.seedImage=https://example.com/perfume-8k.jpg \
  inputs.maskImage=https://example.com/perfume-cap-mask.png \
  settings.editRegion=auto
```

**JSON**:

```json
{
  "taskType": "imageInference",
  "taskUUID": "4b9e2c17-8f3a-4d06-b5e1-9a7c3f2d6e84",
  "model": "ideogram:4.5@precise-edit",
  "positivePrompt": "Change the gold cap of the perfume bottle to a matte black cap of the same shape and size. Keep everything else in the image exactly the same.",
  "inputs": {
    "seedImage": "https://example.com/perfume-8k.jpg",
    "maskImage": "https://example.com/perfume-cap-mask.png"
  },
  "settings": {
    "editRegion": "auto"
  }
}
```

A box and a mask also work together. Send both, and **the mask must sit inside the box**.

### [Limits of a box](https://runware.ai/docs/models/ideogram-4-5-precise-edit/guides/region-edits#limits-of-a-box)

A box the API accepts meets five rules:

- **Inside the source.** Every coordinate is a whole number from 0 to the width or height of `inputs.seedImage`.
- **At least 256 pixels per side.**
- **An aspect ratio between 1:6 and 6:1.**
- **At most 4,194,304 pixels**, such as 2048 × 2048. On a 7680 × 4320 source that is about an eighth of the frame.
- **Room for the mask.** A mask sent with the box has to sit inside it.

### [When to leave the region out](https://runware.ai/docs/models/ideogram-4-5-precise-edit/guides/region-edits#when-to-leave-the-region-out)

A change meant for **the whole frame**, such as relighting or a change of season, does not fit in one region on a large source. Without `settings.editRegion` it comes back at about 4 megapixels, so keep regions for the local changes and run the global pass last, the order [Iterative editing](https://runware.ai/docs/models/ideogram-4-5-precise-edit/guides/iterative-editing) recommends for any chain.

A source at or under 4,194,304 pixels already comes back at its own size. There a region is only worth it as **a hard boundary** around the edit.

### [Tips](https://runware.ai/docs/models/ideogram-4-5-precise-edit/guides/region-edits#tips)

1. **Box the whole object.** The edit stops at the edge of the box, so leave a margin for the shadow and anything else the change touches.
    
2. **Measure on the full-size source.** The coordinates count pixels of `inputs.seedImage` itself, not of a preview.
    
3. **One region per request.** For two areas far apart, run two edits in a row, each with its own box, and the image keeps its full size through both.
    
4. **Use `auto` when the mask exists.** It saves working out a box, and the region stays fitted to the target.