Image Inpainting
Regenerating a masked region of an image while leaving the rest untouched.
What is image inpainting?
Image inpainting is a computer vision technique that reconstructs or replaces a selected region of an image while keeping the rest untouched. Originally used to restore damaged photographs and remove objects, it is now commonly performed by diffusion models, which fill the masked region with new, context-aware content.
In virtual try-on, inpainting confines generation to the clothing region: the face, hair, and background of the original photo are preserved pixel-for-pixel, and only the garment area is regenerated.

How it works in a try-on pipeline
- Mask creation: image segmentation produces a pixel-precise mask of the garment to replace.
- Context encoding: the model analyzes everything outside the mask: skin tone, lighting direction, background.
- Conditioned regeneration: the masked area is filled with the new garment, guided by the product image and the person's pose.
- Blending: mask edges are feathered so the regenerated region transitions smoothly into the preserved pixels.
Main challenges
- Mask accuracy: a mask that misses a sleeve leaves the old garment visible; one that is too large erodes hands or hair.
- Occlusion: hair or crossed arms in front of the clothing must remain in the foreground.
- Boundary realism: visible seams between generated and original pixels break the illusion, especially at collars and hems.
FAQ
Questions, answered.
Is inpainting the same as content-aware fill?↓
Same idea, different capability. Content-aware fill copies surrounding textures to hide an object; generative inpainting synthesizes new, semantically correct content, such as a garment that was not in the photo.
Related terms
- Diffusion Model
- A generative AI architecture that creates images by learning to reverse a gradual noising process.
- Image Segmentation
- A computer vision technique that divides an image into pixel-precise regions, such as a person, their clothing, and the background.
- Garment Transfer
- The AI process of rendering a clothing item from a product photo onto an image of a person.
- Occlusion
- Hiding the right parts of a virtual object behind real-world elements that are closer to the viewer.