😺NKD Inpaint Stitch
Composite the regenerated region back at full resolution, seam invisible
- image
- crop_data
- image
Every half-decent inpainting workflow ends the same way: a VAE round-trip that slowly degrades the whole image, unless you deliberately paste only the changed pixels back onto the original. That paste is the entire job of 😺NKD Inpaint Stitch - take the processed crop(s), put them back at native resolution, and blend the seam until it doesn't announce itself. It's the second half of the 😺NKD Inpaint Crop pair, and it's how "only the masked area changed" becomes a property of the graph instead of something you remember to do.
You feed it the processed crop and the crop_data from 😺NKD Inpaint Crop, and it knows exactly where everything goes back - including when separate_regions was on, in which case all the detailed regions get stitched sequentially in one pass.
The inputs that make or break the seam
image- the processed (inpainted) crop or crops.crop_data- from Inpaint Crop. This is what makes the paste land in the right place at the right angle.feather- softens the edge of the pasted area, in pixels of the original image. Default 10.edge_hardness- firms up the blend edge to stop the original background ghosting through as a halo. 0 = off, 1 = hard edge. This is the first tool when the old content shows at the boundary.match_colors- pulls the colors of the regenerated area back toward the original image, correcting the slight color and brightness drift models introduce. This is the fix for the classic "the inpainted patch has a different exposure" complaint - it's deterministic, instant, and it's the difference between a patch and a paste.seamless_edges- an extra pass that erases any remaining color or lighting seam at the edge. Heavier, and can smear fine texture - the author's advice is to use it only if a seam survives Match Colors. Requires OpenCV.
The debugging order
If you can see the seam, don't reach for the heavy hammer. Feather up first, then match_colors, then edge_hardness - and only if the seam is still there, seamless_edges. People who jump straight to the seamless pass end up with a soft, smeared boundary where they wanted a crisp composite.
Output is a single image: the original with the detailed region(s) composited back.
Install and gotchas
Install via ComfyUI Manager (search ComfyUI-NKD-Basic-Tools) or:
cd ComfyUI/custom_nodes
git clone https://github.com/Nekodificador/ComfyUI-NKD-Basic-Tools
Restart after. Pack dependencies are onnxruntime and huggingface_hub; neither is needed here, though seamless_edges specifically needs OpenCV (which standard ComfyUI installs bring along anyway). The recurring community failure this node prevents is skipping the composite entirely - the "PLEASE composite your image after inpainting" PSA from a couple of years back exists because three or four uncomposited passes turn an image to trash. If you're using the crop-stitch pair, that can't happen to you; if you're not, this is your reminder.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | The processed (inpainted) crop(s). | |
| crop_data | NKD_CROPDATA | — | |
| feather | INT | 100–256 | Softens the edge of the pasted area, in pixels. |
| edge_hardness | FLOAT | 0.000–1 | Firms up the blend edge to stop the original background from ghosting through as a halo. 0 = off, 1 = hard edge. |
| match_colors | FLOAT | 0.000–1 | Pulls the colors of the regenerated area back toward the original image, correcting the slight color and brightness drift models introduce. 0 = off, 1 = full match. |
| seamless_edges | BOOLEAN | false | Extra pass that erases any remaining color or lighting seam at the edge. Heavier, and can smear fine texture — use only if a seam is still visible after Match Colors. Requires OpenCV. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | Original image with the detailed region(s) composited back. |