Skip to content

Docs

API docsOpen Ideogram

Masks and Inpainting

Use image masks and inpainting in Precise Edit or GPT Image 2.5: mask versus edit window, reference limits, multi-turn editing and how to fix a blocked edit.
On this page

A mask marks the part of an image you want to change. Editing a marked area is often called inpainting. Use it to:

  • change or remove one object, such as a cup on a table or a sign on a wall
  • change a face, an outfit or the colors of one item
  • replace the background behind a person or product
  • retouch or restore one part of an old or damaged photo

Ideogram 4.6, Ideogram 4.5 and GPT Image 2.5 take masks.

Precise Edit with Ideogram 4.6

Choose Ideogram 4.6 in Precise Edit to change an image with a prompt and an optional mask. Quality starts at Medium; Very low, Low and High are also available. Check the price on Apply edit after choosing your settings.

The 4.6 edit window can cover up to 16,777,216 pixels (4096 × 4096), with a longest side of 8192 px. Ideogram 4.5's window covers up to 4,194,304 pixels (2048 × 2048), with a longest side of 4608 px. These limits describe the area the model works on. At Very low quality, 4.6 also uses the 2K area limit and 4608 px side limit. See edit windows.

To keep a large source image at its full size, use an edit window within these limits. Editing the whole image above the area limit scales the result down. An automatic window needs a mask that fits within the limit; a larger mask can fall back to a whole-image edit.

Mask an image with Ideogram 4.6 or 4.5

Both models use the following mask tools in Precise Edit. The screenshots show the 4.5 workflow.

  1. Open the image and select Edit. Precise Edit opens with your image loaded.

  2. On the image, select Add a mask.

    Precise Edit with a living room photo loaded and the Add a mask button highlighted on the image

    Select Add a mask on your image.

  3. Mark the part you want to change with a tool:

    • Magic wand: click an object to select it. Click more parts to add them.
    • Brush: paint over the area.
    • Lasso: draw around the area.
    • Rectangle: drag a box.

    Switch to Erase to remove part of the mask, or use Clear mask to start again.

    Mask editor with the sofa selected in blue, the Add, Erase, Magic wand, Brush, Lasso and Rectangle tools highlighted, and the Done button highlighted

    The sofa is masked with Magic wand. Click Done when the mask covers the area.

  4. Click Done.

  5. Under What should change?, describe the change for that area, such as "mustard yellow velvet upholstery".

  6. Optional: choose Quality and Number of images. See Precise Edit settings.

  7. Click Apply edit. The button shows the cost.

    Precise Edit with the sofa masked, the prompt Mustard yellow velvet upholstery entered under What should change, and the Apply edit button highlighted with its cost

    Describe the change, then click Apply edit.

You can also add reference images that show the result you want: up to 3 with a mask, or 4 without one. Adding a mask uses one reference slot, so remove an extra reference if you're already at the limit. Eligible accounts can use weekly free credits for Precise Edit. The price depends on the model, quality and source image size; check Apply edit before running. Without a weekly allowance, or after it runs out, you need a paid plan or bought credits.

Precise Edit settings

  • Quality: Very low, Low, Medium or High. The default is Medium.
  • Number of images: 1 to 8 results per run. The default is 1.

Changing either setting changes the cost shown on Apply edit. You can also leave the image unmasked when you want an edit across the whole image.

Limit the edit with an edit window

If Use Edit Window is available on your account, it keeps the edit inside one part of the image. This option appears under Advanced settings once you've added a source image.

  1. Open Advanced settings.

  2. Turn on Use Edit Window.

  3. Choose Specific area to pick the area yourself, or Auto (requires mask) to base it on your mask.

    Advanced settings open in Precise Edit with Use Edit Window turned on and the Specific area and Auto (requires mask) options highlighted

    Use Edit Window sits under Advanced settings.

Areas outside the mask can still change slightly, so compare the result with the original before you use it. A mask marks what you want to change; an edit window limits the region that the edit can use. You can use a specific window without a mask, while Auto (requires mask) is unavailable until you add one.

When using both, put the mask inside the window. Painted areas outside it are left out of the edit. If you see Paint inside the edit window, or move the window over what you painted, move the window over the selection or repaint inside it before trying again.

If the window switch is unavailable, check its explanation. A small image can't use an edit window. An image that is too wide or tall to edit as a whole always uses one, so you can't turn it off.

Edit again and again (multi-turn editing)

Multi-turn editing means using one edit's result as the source for the next. Change one thing per turn, say what should stay the same, and inspect each result before continuing. If a step moves away from what you want, start the next edit from an earlier saved result instead.

  1. Make your first edit in Precise Edit and wait for the result.
  2. Open the result and select Edit. Precise Edit opens again with that result loaded.
  3. Mask the next area if you want, describe the next change, and click Apply edit.
  4. Repeat for each change.

Each result saves to Assets and Library → Generations, so you can open an earlier step and branch from it. Selecting Edit loads that result; it does not automatically run the next change.

Three edits in a row with Ideogram 4.5. Each prompt changed one thing and kept the rest:

A bright living room with a light gray sofa, an abstract print in a black frame, a round wooden table with tulips and a sheer-curtained window

Original.

The same living room with the sofa changed to deep green velvet and nothing else changed

Edit 1: the sofa is now green velvet.

The same room with the abstract print replaced by a framed fern illustration

Edit 2: the print is now a fern illustration.

The same room in the evening, with dusky blue light at the window and the table lamp on

Edit 3: evening light, with the lamp switched on. Every object stays in place.

The prompts for that example:

  1. "Change the sofa upholstery to deep forest green velvet. Keep the sofa's shape and the rest of the room exactly the same."
  2. "Replace the abstract print inside the black frame with a vintage botanical illustration of a large fern. Keep the frame and everything else exactly the same."
  3. "Make it evening: dusky blue light through the window, and the table lamp switched on. Keep every object exactly where it is."

More examples

A storefront rebrand over nine edits. Four of them are shown here:

A brick storefront with a gray shingle awning, a parked blue car on the left and a trash can by the door

Original.

The same storefront with the car and trash can removed and the street filled in

Edit 1: the car and trash can removed.

The storefront with a navy awning and the sign HALDEN & CO. in gold letters above it

Edit 3: a navy awning and a gold sign.

The finished storefront at dusk with lit windows full of books, planters by the door and a chalkboard sign

Edit 9: the finished shop at dusk.

Photo restoration in three edits:

A damaged black-and-white photo of a 1920s wedding party with scratches, stains and faded tones

Original: a damaged 1920s wedding photo.

The same photo restored in black and white, with scratches and stains removed

Edit 1: scratches, stains and fading repaired.

The restored photo colorized with ivory dresses, pink and white flowers and green foliage

Edit 2: colorized.

The colorized photo turned into a crisp modern-looking photograph of the same moment

Edit 3: sharpened into a modern-looking photo.

For restoration, the first prompt was: "Restore this old photograph: remove every scratch, dust speck, stain, crease, tear and film blemish, even out the faded tones and recover the detail. Keep it black and white and keep every person and letter exactly as it is."

Mask with GPT Image 2.5

  1. Click Image in the sidebar.
  2. In the Model picker, choose GPT Image 2.5 Flare or GPT Image 2.5 Sunburst.
  3. Add a reference image.
  4. On the first image, select Add a mask.
  5. Mark the part you want to change with Magic wand, Brush, Lasso or Rectangle. Use Clear mask to start again.
  6. Click Done.
  7. Describe the change and click Generate.

"A masked run keeps the shape of the image you painted on," so Aspect ratio is locked while a mask is on.

If Precise Edit will not start

  • Attach a Source image and enter an instruction under What should change? A mask alone does not describe the replacement you want.
  • If you see Wait for the mask to finish processing, wait for that step before applying the edit.
  • If adding a mask takes you over the reference limit, remove an extra reference. The app allows three reference images with a mask or four without one.
  • If an edit window and a mask do not overlap, move the window or repaint the mask as described above.

Change a mask

On either model, select Edit mask on the image to change the mask, then click Done.

Other ways to change one area

  • Select area in Studio works the same way on one layer of a Studio canvas. It needs a paid plan.
  • The Object Remover app takes an object out and fills the gap, with no prompt. See Remove Backgrounds and Objects.
  • Remove BG cuts out the subject instead of changing the background. See Remove Backgrounds and Objects.
  • To add to an image beyond its edges (outpainting), use Extend in Studio.

In this topic: editing

  1. Edit Images: choose the right way to edit
  2. Masks and Inpainting (this page): change only one area
  3. Studio: combine images, layers and text
  4. Text and Layers: fix or add lettering
  5. Remix: make new versions of an image
  6. Troubleshooting: fix common problems
In the API

Edit one region with a mask shows the mask format for Precise Edit and Inpaint, with code.