---
title: Masked edits — Ideogram 4.5 Precise Edit | Runware Docs
url: https://runware.ai/docs/models/ideogram-4-5-precise-edit/guides/masked-edits
description: How to limit an Ideogram 4.5 Precise Edit to one region with a mask, from picking one object out of several to printing a reference graphic onto a garment.
---
### [Introduction](https://runware.ai/docs/models/ideogram-4-5-precise-edit/guides/masked-edits#introduction)

A mask tells Ideogram 4.5 Precise Edit **where an edit is allowed to land**. You pass a black and white image the same size as the source, white over the region to change, and the instruction is aimed there. Whatever the edit does not change comes back from the source untouched, the same way it does on any Precise Edit.

That turns one photo shoot into **every colorway of the product**. The jacket below was shot once in olive, and each variant is one masked edit on that frame.

**Original**:

![A man in an olive green quilted puffer jacket over a white t-shirt and dark jeans, standing against a warm white studio wall](https://runware.ai/docs/assets/source-jacket.wlBFlgUt_Z2uPzRd.jpg)

> **Prompt**: Photorealistic e-commerce fashion photograph of a man in his early thirties with short dark hair and a trimmed beard, standing relaxed and facing the camera against a plain warm white studio wall. He wears an olive green quilted puffer jacket, zipped halfway, over a plain white t-shirt, with dark indigo jeans. Three-quarter length framing from mid-thigh to just above the head, the man centered, arms relaxed at his sides. Soft even studio light, crisp fabric detail, catalog lookbook style.

**Mask**:

![The mask for the colorways: a black frame with a white polygon covering the torso and arms, below the neck](https://runware.ai/docs/assets/mask-jacket.BgHj-92g_Z2bLRkl.jpg)

**Sage**:

![The same man and pose with the puffer jacket in soft sage green](https://runware.ai/docs/assets/colorway-sage.CCh2cpam_Zi9Du4.jpg)

> **Prompt**: Change the color of the quilted puffer jacket to a soft sage green. Keep its shape, its quilting, its zipper and the way it sits on him exactly the same.

**Rust**:

![The same man and pose with the puffer jacket in deep rust orange](https://runware.ai/docs/assets/colorway-rust.DZRGx-8O_ZrSsuF.jpg)

> **Prompt**: Change the color of the quilted puffer jacket to a deep rust orange. Keep its shape, its quilting, its zipper and the way it sits on him exactly the same.

**Navy**:

![The same man and pose with the puffer jacket in dark navy blue](https://runware.ai/docs/assets/colorway-navy.dvwd9RuK_Z18vtqy.jpg)

> **Prompt**: Change the color of the quilted puffer jacket to a dark navy blue. Keep its shape, its quilting, its zipper and the way it sits on him exactly the same.

Switch to the mask to see the region every colorway was aimed at, then through the variants. The quilting lines and the zipper sit in the same place in all four, and his face and the studio wall never change.

This guide covers the mask rules, using a mask to pick one object out of several, placing something new, combining a mask with references and making a mask of your own.

### [How the mask works](https://runware.ai/docs/models/ideogram-4-5-precise-edit/guides/masked-edits#how-the-mask-works)

The mask goes in `inputs.maskImage`, next to the source in `inputs.seedImage`. Four rules decide whether it works:

- **White edits, black keeps.** White marks where the edit goes. It is a strong guide rather than a clipping path, as the desk example below shows.
- **Same size as the source.** The mask must match the pixel dimensions of `inputs.seedImage` exactly.
- **Both regions present.** A mask that is entirely white or entirely black is rejected.
- **Hard edges only.** Gray values round to the nearest of black or white, so a feathered brush does not feather the edit.

The jacket mask in the hero is a rough polygon, not a cutout. It covers the jacket **with room to spare** and stops below the chin, so the face sits outside the region the edit is aimed at. The instruction does the fine work of finding the jacket inside that region, which is why the white t-shirt under the mask stays white.

**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 color of the quilted puffer jacket to a soft sage green. Keep its shape, its quilting, its zipper and the way it sits on him exactly the same.',
  inputs: {
    seedImage: 'https://example.com/jacket-olive.jpg',
    maskImage: 'https://example.com/jacket-mask.png'
  }
})
```

**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 color of the quilted puffer jacket to a soft sage green. Keep its shape, its quilting, its zipper and the way it sits on him exactly the same.",
            "inputs": {
                "seedImage": "https://example.com/jacket-olive.jpg",
                "maskImage": "https://example.com/jacket-mask.png"
            }
        })

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": "3b8e1f6a-92c4-4d07-a5e1-7c0f2d9b4e63",
      "model": "ideogram:4.5@precise-edit",
      "positivePrompt": "Change the color of the quilted puffer jacket to a soft sage green. Keep its shape, its quilting, its zipper and the way it sits on him exactly the same.",
      "inputs": {
        "seedImage": "https://example.com/jacket-olive.jpg",
        "maskImage": "https://example.com/jacket-mask.png"
      }
    }
  ]'
```

**CLI**:

```bash
runware run ideogram:4.5@precise-edit \
  positivePrompt="Change the color of the quilted puffer jacket to a soft sage green. Keep its shape, its quilting, its zipper and the way it sits on him exactly the same." \
  inputs.seedImage=https://example.com/jacket-olive.jpg \
  inputs.maskImage=https://example.com/jacket-mask.png
```

**JSON**:

```json
{
  "taskType": "imageInference",
  "taskUUID": "3b8e1f6a-92c4-4d07-a5e1-7c0f2d9b4e63",
  "model": "ideogram:4.5@precise-edit",
  "positivePrompt": "Change the color of the quilted puffer jacket to a soft sage green. Keep its shape, its quilting, its zipper and the way it sits on him exactly the same.",
  "inputs": {
    "seedImage": "https://example.com/jacket-olive.jpg",
    "maskImage": "https://example.com/jacket-mask.png"
  }
}
```

### [Picking one object out of several](https://runware.ai/docs/models/ideogram-4-5-precise-edit/guides/masked-edits#picking-one-object-out-of-several)

An instruction names a thing, and **a frame with two of that thing is ambiguous**. The sofa below has two identical pillows, and the instruction asks for "the throw pillow".

**Source**:

![A light gray three-seat sofa against a white wall with two identical cream pillows, one in each corner](https://runware.ai/docs/assets/source-sofa.BYDI2ZkV_ZnFNwv.jpg)

> **Prompt**: Photorealistic furniture catalog photograph of a light gray three-seat fabric sofa standing against a plain white wall on a pale oak floor, with two identical plain cream linen throw pillows, one propped in each corner of the sofa. Straight-on shot at seat height with a 50mm lens, the sofa centered and filling the middle of the frame. Soft daylight from the left, gentle shadows, clean neutral palette.

**Without a mask**:

![The sofa after the edit without a mask, with both pillows changed to mustard yellow velvet](https://runware.ai/docs/assets/output-pillow-unmasked.bZtt1IS6_TT6yQ.jpg)

> **Prompt**: Change the throw pillow to a mustard yellow velvet pillow of the same size. Keep everything else in the image exactly the same.

**Source and mask**:

![The same sofa with the masked area over the left end highlighted](https://runware.ai/docs/assets/source-sofa.BYDI2ZkV_ZnFNwv.jpg)

> **Prompt**: Photorealistic furniture catalog photograph of a light gray three-seat fabric sofa standing against a plain white wall on a pale oak floor, with two identical plain cream linen throw pillows, one propped in each corner of the sofa. Straight-on shot at seat height with a 50mm lens, the sofa centered and filling the middle of the frame. Soft daylight from the left, gentle shadows, clean neutral palette.

**With the mask**:

![The sofa after the masked edit, with only the left pillow changed to mustard yellow velvet and the right one still cream](https://runware.ai/docs/assets/output-pillow-masked.CQXtfSaD_Zssd2b.jpg)

> **Prompt**: Change the throw pillow to a mustard yellow velvet pillow of the same size. Keep everything else in the image exactly the same.

Without the mask, the model has to decide which pillow you meant, and it changed both. With the mask over the left end of the sofa, **only the left pillow changes** and the right one stays cream linen. The instruction did not get more specific. The mask answered the question the words left open.

Rewording can sometimes do the same job ("the pillow on the left"), but a mask is **the answer that does not depend on wording**, which matters when the same edit runs across a catalog of photos with different layouts.

### [Placing something new](https://runware.ai/docs/models/ideogram-4-5-precise-edit/guides/masked-edits#placing-something-new)

When the edit adds an object, the mask marks **where the object goes**. The instruction below only asks for a plant on the desk, and the mask puts it beside the notebook.

**Source and mask**:

![A white desk against a light gray wall, with a laptop and a notebook on the left and a tall masked area just right of the notebook](https://runware.ai/docs/assets/source-desk.BJZ-n49U_Z21Ec0p.jpg)

> **Prompt**: Photorealistic lifestyle photograph of a minimal home office: a white desk against a plain light gray wall, a closed silver laptop and a small notebook on the left side of the desk, and the right half of the desk top completely empty. Straight-on shot at desk height with a 35mm lens, the desk top running across the lower middle of the frame. Soft window light from the right, clean and bright.

**Result**:

![The same desk with a potted snake plant standing just right of the notebook](https://runware.ai/docs/assets/output-desk-left.B0bIkYz3_qYnbI.jpg)

> **Prompt**: Add a potted snake plant in a matte white ceramic pot standing on the desk. Keep everything else in the image exactly the same.

The mask does not set the size, though, and **it is not a clipping path**. The top leaf above already grows past the region, and with a small square instead the plant came back at about the same size: the pot fills the square and the leaves grow well past its top edge.

**Source and mask**:

![The same desk with a small square masked area on its right side](https://runware.ai/docs/assets/source-desk.BJZ-n49U_Z21Ec0p.jpg)

> **Prompt**: Photorealistic lifestyle photograph of a minimal home office: a white desk against a plain light gray wall, a closed silver laptop and a small notebook on the left side of the desk, and the right half of the desk top completely empty. Straight-on shot at desk height with a 35mm lens, the desk top running across the lower middle of the frame. Soft window light from the right, clean and bright.

**Result**:

![The desk with a potted snake plant on its right side, the pot filling the small square and the leaves rising well above it](https://runware.ai/docs/assets/output-desk-small.K1ex4aRq_Z2dM4vB.jpg)

> **Prompt**: Add a potted snake plant in a matte white ceramic pot standing on the desk. Keep everything else in the image exactly the same.

So draw the region **for the whole object**, leaves and contact shadow included, rather than for the part you picture first. A region that is too small does not shrink the object, it only gives up control over where the overflow goes.

### [Masks with references](https://runware.ai/docs/models/ideogram-4-5-precise-edit/guides/masked-edits#masks-with-references)

A mask combines with `inputs.referenceImages`, which is how a reference graphic lands on an exact spot. With a mask, Precise Edit accepts **up to three references**, one fewer than without.

**Source and mask**:

![A woman in a plain heather gray hoodie against a light gray backdrop, with the masked area over the chest highlighted](https://runware.ai/docs/assets/source-hoodie.htZD8_jX_1Eh4gQ.jpg)

> **Prompt**: Photorealistic apparel mockup photograph of a woman in her mid twenties with her hair tied back, standing facing the camera against a plain light gray studio backdrop, wearing a plain heather gray pullover hoodie with no print and the hood down, and black leggings. Framed from mid-thigh to just above the head, the chest of the hoodie clearly visible and centered. Soft even studio light, realistic cotton fleece texture.

**Result**:

![The woman in the heather gray hoodie, now with the navy and coral SUMMIT RUN CLUB badge printed on the chest](https://runware.ai/docs/assets/output-hoodie-print.BMv69FId_2a9IOU.jpg)

> **Prompt**: Screen print the circular badge graphic from the reference image on the chest of the hoodie, centered, following the folds of the fabric. Keep everything else in the image exactly the same.

**Reference**:

![A circular navy and coral badge with a mountain peak and trail, reading SUMMIT RUN CLUB and EST. 2024](https://runware.ai/docs/assets/reference-badge.BgA9fqvU_1mCQvF.jpg)

> **Prompt**: Flat two-color vector badge graphic for a running club, printed on a plain white background: a circular badge with a stylized mountain peak and a winding trail in the center, the words "SUMMIT RUN CLUB" in bold condensed sans-serif capitals curving around the top, and "EST. 2024" along the bottom. Deep navy and coral orange only, clean edges, centered.

The mask decides **where the print goes**, and the reference decides what it looks like. The badge comes through intact, lettering and trail included, centered in the masked area of the chest. That is a print-on-demand mockup: one blank garment photo, any customer's artwork.

### [Making a mask](https://runware.ai/docs/models/ideogram-4-5-precise-edit/guides/masked-edits#making-a-mask)

Paint over the region you want to change and download the result. The file comes out **white on black at the source's own size**, which is the format `inputs.maskImage` expects.

Interactive component not available in Markdown.

For a repeatable pipeline, draw the mask in code instead. A rectangle or polygon over a known region is usually enough, because the instruction finds the object inside it and restoration puts everything else back.

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

Without a mask, the instruction **applies to the whole image**, and restoration still returns every pixel the edit did not change. That is the right call for changes that are meant to touch the whole frame, such as relighting or a change of season, and for targets that appear only once. See [Iterative editing](https://runware.ai/docs/models/ideogram-4-5-precise-edit/guides/iterative-editing) for a whole chain run without masks.

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

1. **Paint generously.** A region with room to spare beats a tight cutout that clips a sleeve, and a new object needs space for all of itself or it spills past the edge.
    
2. **Keep naming the target.** The mask limits where the edit can happen, and the instruction still says what to change inside it.
    
3. **Export at the source's exact size.** A mask one pixel off in either dimension is rejected.
    
4. **Count your references.** A masked edit takes three at most, four without the mask.