What is Mask?
Also known as: Alpha mask, Selection mask
A grayscale image that defines which pixels of a primary image should be edited (white) vs. preserved (black) during inpainting or compositing operations.
In detail
A mask is a single-channel grayscale image, the same dimensions as the target image, that defines per-pixel edit intent. White pixels (255) mark regions to fully edit; black pixels (0) mark regions to fully preserve; gray values blend between the two. In AI inpainting, the mask tells the diffusion model which region to regenerate — only masked pixels go through the denoising loop. In seamless tile creation, the mask is typically a vertical or horizontal band centered on the offset seam: white in the band (telling the AI to heal the seam), black outside (preserving the user's original middle pixels). Mask design matters: too narrow a mask gives the AI insufficient context to heal naturally; too wide a mask causes the AI to invent content that didn't exist in the source. In modern AI workflows, masks also drive control over generation — a mask defines which pixels the diffusion model should regenerate (inpainting), which to preserve as context (outpainting reference), and how aggressively to blend at boundaries (mask feathering). Mask quality often determines AI output quality more than prompt or model choice.
Example
A 1024×1024 tile is shifted by 512 pixels horizontally so the seam is in the middle. A 1024×1024 mask is generated: black everywhere except a vertical band 200 pixels wide centered at x=512, which is white. SDXL Inpaint heals only the white band, blending the seam into the surrounding context.