GPT Image 2.5 mask_url edit: change one region, keep the rest
GPT Image 2.5 on Sume accepts a public mask_url alongside input_references. Build a mask with Pillow, host it, and edit only one region of a photo.

To change only part of an image, pass the photo in input_references and a second image as mask_url on openai/gpt-image-2.5. The Sume docs list mask_url as an optional public HTTPS mask URL for ChatGPT Image 2.5 edits (Image API docs), so treat it as a GPT Image 2.5 option and do not send it to other models. The prompt then describes what should appear in the masked area.
I could not confirm from Sume's docs which mask color marks the edit zone, so test with a small image first and flip the mask if the wrong region changes.
What does each piece do?
Read 2026-10-01.
| Field | Role |
|---|---|
input_references | The original photo, public HTTPS |
mask_url | Public HTTPS mask image; match the photo's size |
prompt | What should appear in the masked region |
quality | Higher quality costs more; fal lists $0.05268 high at 1024 square |
How do I build the mask?
Make a black image the size of your photo and fill the region you want changed with white. Save as PNG, upload it somewhere public, and use that URL.
from PIL import Image, ImageDraw
W, H = 1024, 1024
mask = Image.new("L", (W, H), 0)
draw = ImageDraw.Draw(mask)
draw.rectangle((300, 600, 724, 900), fill=255)
mask.save("mask.png")
print("mask.png", mask.size, "white box = region to change")How do I test it?
Generate with a low-cost setting first: set quality to low and look at which region changed. If it is the inverse, invert the mask with ImageOps.invert. Then raise quality for the final. Keep the prompt narrow ('replace the mug with a blue ceramic mug') and avoid asking for global changes, which fight the mask.
Good first edits to try
Start with objects that have clear edges: swap a mug, change a sign, remove a small item by asking for the surrounding surface to continue. Avoid faces and hands for the first test; they expose seams and anatomy errors that make it hard to judge whether the mask itself works.
Limits
The mask must be reachable by the API at a public HTTPS URL, so a local file path will not work. Edges of a hard rectangle can show a seam; blur the mask edge by a few pixels. The mask convention is not spelled out in what I read, which is why the test step matters. Prices on fal are a vendor reference only; Sume bills its own price in usage.cost.
Sources
Related posts
More in Models
- GPT Image 2.5 character drift: what OpenAI says and what to send
OpenAI's image guide says GPT Image may struggle to keep a recurring character the same across generations. What to send on Sume to reduce drift.
- gpt-image-2.5 smallest custom size: the 655,360-pixel floor
gpt-image-2.5 on Sume rejects images under 655,360 pixels. Why 512x512 and 768x768 fail, which small sizes pass, and the other edge rules to check first.
- GPT Image 2.5 misspells a brand name: spell it letter by letter
OpenAI's prompting docs say to quote the text and spell tricky words letter by letter. The prompt to write, and how to check the result on Sume's image API.
- GPT Image 2.5 text in the wrong place: fix it with a mask edit
OpenAI says GPT Image 2.5 can still misplace text. Mask only the text zone and re-render that region through Sume's mask_url edit instead of the whole image.
Written by Sume