Przejdź do treści
Universal parameters

Inpainting

Inpainting is the process of modifying or replacing a specific section of an image while preserving the surrounding composition. You paint a mask over the area you want to alter and provide a prompt describing the replacement, leaving the rest of the canvas completely untouched. It allows targeted fixes and creative changes without needing to regenerate the entire picture from scratch.

Also known as: inpainting, mask, Vary Region, edit, Fill

Side-by-side test results

Inpainting - original
Inpainting - after inpainting: vase with tulips
originalafter inpainting: vase with tulips

Drag the slider to compare. Left: original. Right: after inpainting: vase with tulips.

Inpainting - mask: white rectangle = area to modify
mask: white rectangle = area to modify
Inpainting - no mask: instruction-only edit (FLUX.1 Kontext)
no mask: instruction-only edit (FLUX.1 Kontext)

Model: FLUX.1 Fill [pro] (przez API fal.ai); edycja bez maski: FLUX.1 Kontext [pro]. Settings: rectangular mask in center of frame, seed 1411. Date: 14.11.2026.
Prompt: a glass vase with yellow tulips on the wooden table

In my test, the model dropped a vase with tulips right into the masked area and reconstructed a nearby pitcher because the mask had clipped its side. The surrounding window, ambient lighting, and wooden table remained unaltered. For comparison, I tested an unmasked edit where FLUX.1 Kontext received only the instruction 'make it night, turn on the streetlamp', deciding autonomously which parts of the frame to adjust.

Syntax across generators

GeneratorParameterValuesDefault
Midjourney*Vary Region (Editor)Edycja wybranego fragmentu, reszta bez zmian--
FLUXFLUX.1 Fill [pro]: image + mask; FLUX 3: bounding boxes in promptFill: black = unchanged, white = to repaint; mask optional if image has alpha channel. FLUX 3: boxes [top, left, bottom, right] on 0-1000 gridblack and white mask, same size as image; steps 15-50, guidance 1.5-100steps 50, guidance 60
Ideogrammask (precise edit 4.5 / generate 4.5) ; inpaint ideogram-3NOTE opposite of FLUX/Stability: BLACK = area to edit, WHITE = keep (4.5 and 3.0 inpaint)up to 25 MB, same size as 1st image-
GPT Imagemask (editing)Mask applies to 1st image; prompt-based masking - model may not strictly adhere to mask shapesame format and size as image, <50 MB, must have alpha channel-
SeedreamunconfirmedEditing via text instruction with images; mask parameter not found--
Imagen (retired)mask editing (REFERENCE_TYPE_MASK, maskMode)Inpainting mode names unconfirmed; imagen-3.0-capability-001 model deprecatedblack and white mask, same resolution, up to 10 MB-
Stability AI (SD 3.5)Inpaint: image + mask + grow_maskBlack = unchanged, white = full repaint, grays intermediate; without mask alpha channel is used (transparent = repainted)grow_mask 0-100 pxgrow_mask 5
Qwen-Imageno mask in retrieved documentation (instruction editing)--

* Midjourney: docs.midjourney.com blocks automated scrapers, so values are sourced from search engine indexes. Please verify settings on the official Midjourney site before production use.

When to use it

Common mistake

Drawing the mask too tightly around the target area. The model requires breathing room around the edges to naturally blend new lighting, reflections, and contact shadows into the original scene. Another frequent pitfall is inverting the mask colors: tools like FLUX Fill and Stability use white to indicate the area to alter, whereas Ideogram expects black.

Ready-to-use example

FLUX.1 Fill [pro]:  "image": ..., "mask": ... (white = edit area)
Ideogram (API edit):  mask, black = edit area
GPT Image (edit):  "mask" with alpha channel, same dimensions as source
Midjourney:  Vary Region / web canvas editor
General definition (independent of generator settings): Inpainting in the AI Glossary.

Frequently asked questions

What color should an inpainting mask be?

It depends on the platform you are running. Systems like FLUX Fill and Stability treat white pixels as the editable zone, while Ideogram interprets black pixels as the target area. Always verify your platform's masking conventions before running your task.

Can I edit an AI image without using a mask?

Yes, instruction-driven models such as FLUX.1 Kontext, GPT Image, and Qwen-Image Edit accept plain text prompts to modify scenes directly. However, painting a precise mask still provides far tighter control when you want to isolate a single element.

Why does my inpainted object look pasted on?

This usually happens when the mask boundary is too sharp or sits too close to the object. Expanding the masked area slightly gives the diffusion model enough contextual pixels to calculate realistic contact shadows, edge bounce light, and surface textures.

Related terms

🛒 Sklep Kinetyka CapCut Pro 460 zł/rok Lovable Pro 450 zł/rok Replit Core 119 zł/rok Zobacz wszystko →
× ‹ powiększenie ›