Mask is completely ignored in the image edit api

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

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.