Overlay Inpainted Image
Paste your inpaint crop back onto the original
- inpainted
- overlay_image
- crop_region
- IMAGE
This is the back half of a two-node pair. PrepareImageAndMaskForInpaint crops tightly to your masked region, blurs the mask edge, and hands you a small image ready to inpaint at full resolution - along with a crop_region telling you exactly where that crop came from. Once you've run the sampler and decoded the result, you've got a small inpainted patch, not the full picture. OverlayInpaintedImage is what pastes that patch back into the original at the exact coordinates it was cut from.
This matters more than it sounds like it should. The community's long-standing best practice for inpainting is "composite after inpainting, don't let a VAE decode/encode cycle degrade the whole image" - because if you resample the entire frame instead of just the masked region, you're introducing quality loss everywhere, not just where you meant to fix something. PrepareImageAndMaskForInpaint plus OverlayInpaintedImage structurally enforces exactly that rule: you only ever touch the cropped region, and the rest of the image comes from the untouched original.
How it works
Given the small inpainted result, the original (or overlay-preview) image, and the crop_region coordinates that PrepareImageAndMaskForInpaint produced, it pastes the inpainted patch back into place at those exact coordinates, blended along the same soft edge the prep step created. The output is the full-size image with only the masked region changed.
The inputs and outputs that matter
Three required inputs:
inpainted- the small, inpaintedIMAGE- whatever came out of your sampler and VAE decode, cropped to the mask region.overlay_image- the original full-size image (or theoverlay_imageoutputPrepareImageAndMaskForInpaintalready gave you) to paste the patch onto.crop_region- theCROP_REGIONfromPrepareImageAndMaskForInpaint, telling this node exactly where the crop came from so the paste lines up.
One output: IMAGE - the full-size result with the inpaint composited in.
How to install it
Part of the Art Venture pack. ComfyUI Manager: search comfyui-art-venture, install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/sipherxyz/comfyui-art-venture
then pip install -r comfyui-art-venture/requirements.txt and restart. No model download.
Common issues & troubleshooting
Visible seam or box around the inpainted region. Usually traces back one step: check mask_blur on PrepareImageAndMaskForInpaint wasn't set too low, since that's what softens the paste edge this node relies on. If the blur was fine, confirm crop_region genuinely came from the same prep step that produced inpainted - mismatched coordinates from a different run will misregister the paste.
Skipped this node entirely and just used the small inpainted patch. That's the mistake this node exists to prevent - the sampler only ever sees the cropped region, so its output is just that small patch, not the full image. Without this step you either have to composite manually or you're left with an image the wrong size.
Result looks shifted or offset from where the mask was. The crop_region wire is doing the alignment; if it's disconnected, stale, or sourced from a different prep call than the one that produced inpainted, the paste lands in the wrong place. Trace both inpainted and crop_region back to confirm they came from the same PrepareImageAndMaskForInpaint run.
Working in latent space and want to avoid decoding twice. This node operates on pixels, post-VAE-decode. If you'd rather composite before decoding - say you're chaining into another latent-space step - use OverlayInpaintedLatent instead, which does the same paste-back on the latent directly.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| inpainted | IMAGE | — | |
| overlay_image | IMAGE | — | |
| crop_region | CROP_REGION | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |