π Loop Inpaint Stitch
Paste multiple inpainted regions back into one image
- stitchers
- inpainted_images
- image
This is the back half of SDVN's crop-and-stitch, and its trick is the "loop" part: it can stitch several inpainted regions back into a single image in one pass. Where Inpaint Crop cuts a masked area out for high-res generation, this node drops the finished result - or a whole list of results - precisely back where it came from. Fix the eyes, the mouth, and a hand in one run, and stitch all three back into one clean frame.
That multi-region loop is what makes it worth a dedicated node instead of a plain composite. Feed it a list of stitchers and a matching list of inpainted images and it iterates, placing each one, and returns one finished picture. Pair it with Mask Regions (which splits one mask into separate per-blob masks) and you've got a pipeline that inpaints every detected area independently and reassembles them automatically.
How it works
Back when it did the cropping, Inpaint Crop handed you a stitcher - an opaque bundle recording exactly where each crop came from and how it was scaled. This node takes those stitchers plus the images you generated from the crops, and reverses the operation: it resizes each result back to its original scale and pastes it into the exact spot it was cut from. Because the surrounding pixels were never sent through the sampler (or even the VAE) in the first place, the untouched parts of the image stay byte-for-byte identical - which is the whole reason crop-and-stitch became the default way to inpaint in ComfyUI. The KB's blunt version: composite after inpainting, always, or the VAE round-trip quietly degrades your whole frame. This node makes that composite structural instead of something you have to remember.
The inputs that matter
There are only two, and they're a matched pair from the crop stage:
- stitchers - the STITCHER data from Inpaint Crop. In multi-region use this is a list, one per cropped area.
- inpainted_images - the generated results, one per crop, in the same order as the stitchers.
The single output is image - the fully reassembled picture with every inpainted region dropped back in place.
Common issues
The regions land in the wrong spots, or it errors on mismatched lengths. The stitchers and inpainted images have to line up - same count, same order. If you split a mask into four regions, you need four stitchers and four inpainted images, paired. A mismatch is the number-one failure here.
Visible seams around the fixes. That's usually upstream - the crop's extend padding was too tight, so the model didn't have enough surrounding context to blend. Bump extend on the Inpaint Crop node. The stitch itself is a clean paste; the blending quality is set at generation time.
I only have one region and this feels heavy. It works fine for a single region too - it's just Inpaint Crop β your sampler β Loop Inpaint Stitch. The "loop" only kicks in when you feed it a list. For one fix it's a straightforward crop-generate-stitch.
Installing SDVN_Comfy_node
ComfyUI Manager: search "SDVN_Comfy_node" β install β restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/StableDiffusionVN/SDVN_Comfy_node
Then pip install -r custom_nodes/SDVN_Comfy_node/requirements.txt from the ComfyUI root and restart. Because SDVN ships its own crop/stitch, you don't need the external Inpaint-CropAndStitch pack for this to work. The node is under π SDVN / π Mask.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| stitchers | STITCHER | β | |
| inpainted_images | IMAGE | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | β |