# Mask is completely ignored in the image edit api

**URL:** <https://community.openai.com/t/mask-is-completely-ignored-in-the-image-edit-api/1350867>\
**Category:** Bugs\
**Created:** [August 19, 2025, 4:54am UTC](https://community.openai.com/t/mask-is-completely-ignored-in-the-image-edit-api/1350867 "2025-08-19T04:54:07Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![nom1](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/nom1/32/669780_2.png) [@nom1](https://community.openai.com/u/nom1)\
**Post date:** [August 19, 2025, 4:54am UTC](https://community.openai.com/t/mask-is-completely-ignored-in-the-image-edit-api/1350867/1 "2025-08-19T04:54:07Z")

</div>

Mask is completely ignored in the image edit api. Is this expected?

 ![Screenshot 2025-08-19 at 12.54.00 AM](https://us1.discourse-cdn.com/openai1/original/4X/b/f/0/bf0261d8d667f74253a3187f149e79d46e4cb36d.png)

---

<div class="post-metadata">

**Author:** ![erikm](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/erikm/32/669828_2.png) [@erikm](https://community.openai.com/u/erikm)\
**Post date:** [August 19, 2025, 5:24am UTC](https://community.openai.com/t/mask-is-completely-ignored-in-the-image-edit-api/1350867/2 "2025-08-19T05:24:53Z")

</div>

Unfortunately this appears to be a known limitation of the model. The mask serves as guidance only. Think of it as a way to point to certain areas in the image. But not a way of leaving parts of the image untouched. The model still regenerates the whole image, it just tries its best to redraw the unmasked area as close to original as it can.

[https://platform.openai.com/docs/guides/image-generation?image-generation-model=gpt-image-1](https://platform.openai.com/docs/guides/image-generation?image-generation-model=gpt-image-1)

> Unlike with DALL·E 2, masking with GPT Image is entirely prompt-based. This means the model uses the mask as guidance, but may not follow its exact shape with complete precision.

Here is a test showing that it isn’t completely ignored.

 ![Screenshot 2025-08-18 at 10.20.01 PM](https://us1.discourse-cdn.com/openai1/original/4X/9/4/1/9415d55a6b31486426270d081ff51ddf55c24eb3.jpeg)

 ![Screenshot 2025-08-18 at 10.22.37 PM](https://us1.discourse-cdn.com/openai1/original/4X/8/6/6/866b40e4e8898cafac485593c61e3ca8ef449b20.jpeg)

---

<div class="post-metadata">

**Author:** ![nom1](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/nom1/32/669780_2.png) [@nom1](https://community.openai.com/u/nom1)\
**Post date:** [August 19, 2025, 12:43pm UTC](https://community.openai.com/t/mask-is-completely-ignored-in-the-image-edit-api/1350867/3 "2025-08-19T12:43:57Z")

</div>

No I’m talking about the api. Not ChatGPTcom. The mask is completely ignored.

---

<div class="post-metadata">

**Author:** ![polepole](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/polepole/32/740575_2.png) [@polepole](https://community.openai.com/u/polepole)\
**Post date:** [August 19, 2025, 1:28pm UTC](https://community.openai.com/t/mask-is-completely-ignored-in-the-image-edit-api/1350867/4 "2025-08-19T13:28:07Z")

</div>

> [@Gpt-image-1 problems with mask edits](https://community.openai.com/t/gpt-image-1-problems-with-mask-edits/1240639/54):
>
> As OpenAI Support confirmed on message #37, gpt-image-1 cannot use mask correctly. It regenerates image. And message #41: We need to wait for update. There is no solution yet.

---

<div class="post-metadata">

**Author:** ![nom1](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/nom1/32/669780_2.png) [@nom1](https://community.openai.com/u/nom1)\
**Post date:** [August 19, 2025, 1:47pm UTC](https://community.openai.com/t/mask-is-completely-ignored-in-the-image-edit-api/1350867/5 "2025-08-19T13:47:05Z")

</div>

thanks for the thread, but just to confirm, so chatgptcom is completely able to do inpaint. But for some reason there is no API to do that? Again, I dont care about the soft masking, soft masking is good enough for me. But right now the API **does not mask at all.**

---

<div class="post-metadata">

**Author:** ![\_j](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/_j/32/766292_2.png) [@\_j](https://community.openai.com/u/_j)\
**Post date:** [August 19, 2025, 2:21pm UTC](https://community.openai.com/t/mask-is-completely-ignored-in-the-image-edit-api/1350867/6 "2025-08-19T14:21:56Z")

</div>

API - edits - gpt-image-1

Input with transparency layer mask:

 ![image](https://us1.discourse-cdn.com/openai1/original/4X/c/1/1/c11fa2eccd4b2add43b9347a48b98d2ae1d7e670.jpeg)

> Add a green baby dragon in the same style as the kitty here.

DALL-E 2 would be pixel-perfect, unable to draw anywhere not marked by the mask.

### Results

(add this to the AI models running super-slow right now…)

 ![image](https://us1.discourse-cdn.com/openai1/original/4X/7/3/7/73717e072e276639c69e3cbd075b4676bdf0df66.jpeg)

Employing a mask with an identical pattern to DALL-E 2 - pointless and disobeyed. Not even infilled properly (the transparent mask is drawn-under in black RGB, but that would be invisible to DALL-E 2)

* * *

FYI, here’s prompting alone - and no mask, which would make editing impossible on DALL-E 2:

> Add a green baby dragon and a few other cute animals in the same style as the kitty to half of the boxes.

1. five-minute timeout

2. 

 ![image](https://us1.discourse-cdn.com/openai1/original/4X/5/9/1/5914d0aea28752820ffcb474ac04fbb0d7838c9e.jpeg)

Doesn’t understand “add” means leave the kitty alone.

---

<div class="post-metadata">

**Author:** ![erikm](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/erikm/32/669828_2.png) [@erikm](https://community.openai.com/u/erikm)\
**Post date:** [August 23, 2025, 9:48am UTC](https://community.openai.com/t/mask-is-completely-ignored-in-the-image-edit-api/1350867/7 "2025-08-23T09:48:21Z")

</div>

> [@nom1](#):
>
> No I’m talking about the api. Not ChatGPTcom. The mask is completely ignored.

@nom1 ChatGPT uses the [same model](https://openai.com/index/image-generation-api/) as the API, but here it is in the API as well. You might not have the mask set up right. Mask should be an all white PNG with empty/transparent pixels where you want to change the original image, white where you want to more-or-less preserve original.

```auto
mask
file

Optional
An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where image should be edited. If there are multiple images provided, the mask will be applied on the first image. Must be a valid PNG file, less than 4MB, and have the same dimensions as image.

```

[https://platform.openai.com/docs/api-reference/images/createEdit](https://platform.openai.com/docs/api-reference/images/createEdit)

 ![Screenshot 2025-08-23 at 2.27.41 AM](https://us1.discourse-cdn.com/openai1/original/4X/0/b/4/0b4e5db5f7d2363c192912693e2142b3be611f21.jpeg)

“Add a cartoon cat here, keep everything else the same”

 ![input](https://us1.discourse-cdn.com/openai1/original/4X/3/4/2/342998b8f9af650a59de30bb71d5ca8c86f00129.png) ![mask](https://us1.discourse-cdn.com/openai1/original/4X/a/9/f/a9ff04756a4dd90cb4595addb2072010974f8ce5.png)

“Add a frog here, keep everything else the same”

 ![output](https://us1.discourse-cdn.com/openai1/original/4X/1/3/7/1370b7c5934b4f99b671fafaaf380b62586a8d9a.jpeg) ![mask2](https://us1.discourse-cdn.com/openai1/original/4X/e/f/a/efaf780420ffa987243610af6e290447ceb4ff4d.png)

 ![output2](https://us1.discourse-cdn.com/openai1/original/4X/b/8/e/b8ec9c5a0a7b0ddf9ba1c2ce813dd0434ac313c4.jpeg)

I put the demo CLI in a repo here: [image-edit-demo/README.md at main · erikmalk/image-edit-demo · GitHub](https://github.com/erikmalk/image-edit-demo/blob/main/README.md)

 ![image](https://us1.discourse-cdn.com/openai1/original/4X/b/4/4/b44d4dd634576f8e589e27af7ebfa032f47dab57.jpeg)

---

<div class="post-metadata">

**Author:** ![polepole](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/polepole/32/740575_2.png) [@polepole](https://community.openai.com/u/polepole)\
**Post date:** [August 23, 2025, 2:02pm UTC](https://community.openai.com/t/mask-is-completely-ignored-in-the-image-edit-api/1350867/8 "2025-08-23T14:02:45Z")

</div>

Thank you for sharing your code, work and experience!

This kind of mask editing works well when the objects are simple or when there are only a few, like drawings or cartoon characters. But with real-life objects such as humans or animals, the model often changes their appearance, alters the colours, adds extra objects, or struggles to place the replacement object in the right spot.

For example, in the test below, the model placed the toy in the wrong spot and even created a third hand for the person.

I hope OpenAI makes improvements to this in **`Image Generation v2`** soon.

 ![polepole-screen](https://us1.discourse-cdn.com/openai1/original/4X/6/2/f/62f61582ac13b5282b558d1cf3d9e58c402ad987.jpeg)

 ![polepole-input](https://us1.discourse-cdn.com/openai1/original/4X/3/3/6/336e71de7e133b29fdedb8fd779cf63613f088e5.jpeg)

 ![polepole-output](https://us1.discourse-cdn.com/openai1/original/4X/4/b/5/4b5e6a0f42ae5dd6a0ab0f57e139f4b924b03cc9.jpeg)

---

<div class="post-metadata">

**Author:** ![erikm](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/erikm/32/669828_2.png) [@erikm](https://community.openai.com/u/erikm)\
**Post date:** [August 23, 2025, 8:16pm UTC](https://community.openai.com/t/mask-is-completely-ignored-in-the-image-edit-api/1350867/9 "2025-08-23T20:16:51Z")

</div>

@polepole I totally agree, the way it works now is a major weakness. The only point I was making with the demo is that that it’s not “completely ignored” (or it would have picked a place a random to add the cat and frog). So using the mask feature with this model could be better than nothing in some cases, but we still have to wait for improvements to the model to support true inpainting.
