Inpaint Stitch Pro
Inpaint Stitch Pro's Laplacian and frequency blending
- stitcher
- inpainted_image
- image
- blend_mask_used
- info
Inpaint Stitch Pro is the part of the crop-and-stitch pipeline where the invisible work happens. Paste Back gives you a clean resize-and-paste; this node gives you seam-hiding that actually earns its keep - Laplacian pyramid blending (the technique Photoshop uses for panorama stitching, blending each frequency band separately), edge-aware blending, and FFT frequency-domain blending. When your inpainted region sits on textured background - fabric, hair, grass, brick - a simple paste shows up as a tell. This node is the answer to that tell.
It's the second half of the crop-and-stitch loop with Inpaint Crop Pro, in the C2C/Inpaint suite of ComfyUI-CustomNodePacks (the ~72-node pack from Code2Collapse / Likhith-24).
How it works
Feed it the stitcher from Inpaint Crop Pro and the inpainted_image from your sampler, and it places the crop back using a blend mask that fades the seam across blend_radius pixels instead of cutting it. The controls:
blend_mode_override- the main decision.from_crop(default) honors whatever blend mode the crop node configured; or forcegaussian,edge_aware(feathers along real edges via Sobel),laplacian_pyramid(the heavy hitter for textured backgrounds),frequency_blend(FFT-domain), orvideo_stable(a wide, temporally-smoothed blend zone for video).color_match(default false) - Reinhard-style mean+std color transfer before blending. This is the "the inpainted region has the right content but wrong exposure/color cast" fix. It's cheap and it kills the most common seam tell (a brightness or hue mismatch), so turn it on early.stitch_temporal_sigma(default 0) - post-hoc temporal Gaussian smoothing of the per-frame blend mask. This is the video knob: set 2-4 (≈9-frame window at 3) to stop a jittery per-frame mask from flickering the seam in your footage.stitch_dilate_px- dilates the binary core of the blend mask before temporal smoothing, pushing the seam into flat background. Use with temporal sigma on jittery video.roto_quality_override- the Roto-Sync seam:from_crop(default),force_on(tight-seam stitching even if the crop didn't set it),force_off.
Outputs: image (the final frame), blend_mask_used (the actual blend mask, so you can see what got composited - great for debugging a weird seam), and info.
The recipe for a first working run
image + mask → Inpaint Crop Pro → cropped_image → [sampler] → inpainted_image
└── stitcher ─────────────────────────────────┐
inpainted_image + stitcher → Inpaint Stitch Pro → final
Set blend_mode_override to laplacian_pyramid, flip color_match on, and let it rip. If a seam survives that, it's a sampling problem, not a stitching problem.
Installing it
Ships in ComfyUI-CustomNodePacks. ComfyUI Manager → search "CustomNodePacks", or:
cd ComfyUI/custom_nodes
git clone https://github.com/Code2Collapse/ComfyUI-CustomNodePacks.git
Needs the pack's standard deps (opencv-python>=4.7.0, scipy>=1.10.0) - install just what's missing (not the full requirements.txt, which can clobber ComfyUI's torch). No models. Restart ComfyUI.
Common issues
- Visible seam despite Laplacian - turn on
color_match. Nine times out of ten the visible edge is a brightness/color mismatch, and a mean+std transfer fixes it where fancier blending can't. - Seam flickers in video - that's temporal jitter in the mask. Raise
stitch_temporal_sigma(2-4) and addstitch_dilate_pxto push the blend zone into stable background. - Blurry edges after blending - the blend mask is feathering too much on a region that needed to stay crisp. Drop
blend_radiusat the crop stage, or go back togaussianfor a tighter transition. - The old README mentions a unified "Inpaint Composite" node - the pack has consolidated things over time; if you load a workflow referencing composite modes, check the pack's current docs. This Stitch Pro node is the standalone advanced stitch and still works as documented.
The honest take: Laplacian pyramid and FFT blending are genuinely useful tools, not marketing - and color_match is the single most underrated checkbox in the whole inpaint suite. Start with both and you'll rarely need to chase a seam again.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| stitcher | STITCHER | — | |
| inpainted_image | IMAGE | — | |
| blend_mode_override | COMBO | from_crop | Override the blend mode chosen at crop time, or use 'from_crop'. |
| color_match | BOOLEAN | false | Apply mean+std color transfer before stitching to reduce color shift. |
| stitch_temporal_sigma | FLOAT | 0.00–10 | Post-hoc temporal Gaussian smoothing applied to the per-frame blend mask before compositing. 0 = off. 2-4 = good for jittery segmentation video (≈3 means a 9-frame window). Works on top of any blend mode (gaussian / edge_aware / video_stable / etc.). |
| stitch_dilate_px | INT | 00–128 | Optional dilation (in pixels) applied to the binary core of the blend mask before temporal smoothing — pushes the seam into flat background. Use with stitch_temporal_sigma > 0 for jittery video. 0 = off. |
| roto_quality_overrideopt | COMBO | from_crop | Roto-Sync at stitch time. 'from_crop' honors the InpaintCropProMEC flag (recommended). 'force_on' applies tight-seam stitching even if crop didn't set it; 'force_off' disables it. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| blend_mask_used | MASK | — |
| info | STRING | — |