Skip to content
ComfyUI Workflows3 min read

ComfyUI Inpainting Workflow: Masks and Clean Repairs

Fix a selected area with ComfyUI inpainting. Plan the mask, preserve surrounding detail and inspect the repair before upscaling or animating the image.

AI-generated illustration: A retoucher makes a precise local adjustment to a portrait.

When most of an image is approved, regenerating the entire scene can create unnecessary work. A ComfyUI inpainting workflow lets you concentrate on a selected area: a damaged sleeve, an unwanted background object or a hand that failed the first review.

What the mask controls

The mask identifies the region you want the workflow to modify. In ComfyUI’s official inpainting example, the image and mask feed VAE Encode (for Inpainting). The example uses a dedicated inpainting checkpoint and provides a graph you can load. Follow that model-specific setup before adapting it.

A mask is a production choice. Too little coverage can leave the original problem half intact. Too much coverage gives the model room to change details that were already correct. Start by identifying the entire object or joint involved, including the space needed to make the replacement connect naturally.

Prepare the source and a clear repair instruction

Save an untouched copy of the approved source. Write one sentence naming the repair and one sentence naming what must stay stable. For example: “Replace the distorted cuff with a simple closed navy sleeve. Preserve the arm position, jacket material, background and lighting.”

For a product image, protect the label and logo. If the product’s geometry is wrong, an authentic product photograph or a carefully composed new source may be more reliable than repeated generative repair. The objective is a truthful usable asset, not making every problem fit the same tool.

Run a controlled inpainting pass

  1. Open a compatible inpainting example and select its required model.
  2. Load the image you actually want to repair, checking its dimensions and orientation.
  3. Open the mask editor and cover the intended area with enough surrounding context.
  4. Use a concise description of the replacement rather than rewriting the entire scene.
  5. Generate a small set of candidates.
  6. Compare the candidate against the untouched original before committing it.

The official example documents mask editing and a mask-growth control for the transition region. Interface labels can change, so consult the current Mask Editor documentation when your version differs.

Inspect the seam as carefully as the repair

CheckTypical rejection reason
BoundaryA sharp halo or sudden texture change
LightingThe repaired object casts a shadow in a different direction
GeometryA sleeve or finger connects at an impossible angle
IdentityThe face or a distinctive accessory changes unexpectedly
Product truthNew lettering, altered packaging or an invented feature

Example: remove a distracting object

Suppose a creator portrait has a small, malformed lamp behind one shoulder. Mask the lamp and enough of the surrounding wall to reconstruct a natural background. Ask for a plain wall with the same soft light. Keep the creator outside the intended edit area.

Review the shoulder boundary afterward. A good background repair is not acceptable if it also changes the jacket silhouette or leaves a bright outline around the person. Compare at the final social-media crop as well as at full resolution.

Stop when the repair becomes a new image

If each attempt needs a larger mask and changes more of the scene, reconsider the source. Rebuilding a simpler composition may take less time than repairing a chain of new defects. Keep a repair budget in your production process: a small number of focused attempts, followed by a deliberate regenerate-or-accept decision.

For anatomy-specific review, use the AI hands checklist. For broad scene variations, use image-to-image. To make a new creator batch in a hosted studio, create a persona in Clout and plan simpler source scenes before adding motion.

Questions, answered

Frequently asked questions

What is the difference between a mask and an inpainting model?

The mask selects the area to edit. The model and workflow determine how that region is regenerated.

Why does my repair have a visible edge?

Inspect mask coverage, transition space, lighting and model compatibility. A correct-looking center can still have an unacceptable boundary.

Should I inpaint before making a video?

Repair visible defects in the starting image first. Animation can carry those defects through many frames and make them harder to fix.

Keep building

View all guides