Glossary
Inpainting Basics
How to use AI inpainting to fix, replace, or add elements within a specific region of an existing image.
Inpainting is the process of masking a portion of an image and then regenerating only that region using a text prompt, while leaving the unmasked areas pixel-perfect. It is the primary tool for fixing defects (bad hands, broken backgrounds), swapping elements (outfit changes, object replacement), and extending images beyond their original borders (outpainting).
How it works technically: the masked region is replaced with noise (or partially noised), and the model denoises only that region while using the unmasked pixels as context. Modern inpainting models (SD Inpainting, Flux Fill) are specifically fine-tuned to produce seamless edges — the key challenge is blending the regenerated region with the surrounding image.
Mask quality matters enormously. A rough, over-large mask destroys context and produces jarring seams. A tight mask around the exact target region gives the model maximum context for a believable blend. Feathering the mask edge (softening by 5–20px) helps eliminate hard borders.
Inpainting workflow best practices: (1) Use the same prompt as the original image, adding only the change you want. (2) Set denoising strength to 0.7–0.9 for significant replacements; 0.4–0.6 for refinements. (3) Generate multiple samples — inpainting is stochastic and some fills will be more coherent than others. (4) Use the 'only masked' mode to upscale and refine just the target region at higher resolution.
Outpainting: a variant of inpainting where the canvas is extended beyond the original image borders and the new area is inpainted. Useful for turning a portrait crop into a full-body image or widening a landscape.
Frequently Asked Questions
- Why does inpainting create a visible seam?
- Seams appear when the mask edge is too sharp or the lighting/style of the inpainted region doesn't match the surroundings. Use a feathered mask and include surrounding context in the mask slightly.
- Can I inpaint faces to fix them?
- Yes — face inpainting is one of the most common uses. Mask only the face region, use ADetailer-style face-detection masking if available, and inpaint at 0.5–0.65 strength to correct while preserving identity.
- What is the difference between inpainting and background removal?
- Background removal uses segmentation to isolate the subject and delete the background. Inpainting replaces the background with new AI-generated content. They are often used in sequence.
- Does inpainting work on Flux?
- Flux Fill is the dedicated inpainting variant of Flux and produces state-of-the-art inpaint results, particularly for seamless texture matching.
