Inpaint Stitch Pro
Inpaint Stitch Pro's Laplacian and frequency blending
- stitcher
- inpainted_image
- original_image
- mask
- 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 (27)
| Name | Type | Default | Description |
|---|---|---|---|
| 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. |
| stitcheropt | STITCHER | — | |
| inpainted_imageopt | IMAGE | — | |
| 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. |
| stitch_modeopt | COMBO | blend | blend: the crop's blend mask and blend modes (as before). paste back: resize and paste the crop, optional feathered edge (the former Inpaint Paste Back). smart: the stitch for a crop made in 'smart aspect' mode; needs original_image (the former Smart Image Stitch). context blend: no stitcher - blend a full-frame inpainted image over original_image under mask, with colour correction and lightness rescue (the former Context Inpainter). |
| original_imageopt | IMAGE | [smart / context blend] The original image. | |
| maskopt | MASK | [smart: Mask Feather / context blend] The mask to blend along. | |
| paste_upscale_methodopt | COMBO | bicubic | [paste back] Interpolation method for resizing crop back |
| paste_feather_edgesopt | BOOLEAN | false | [paste back] Apply Gaussian feather at crop boundary |
| paste_feather_radiusopt | INT | 160–64 | [paste back] Feather radius in pixels (only used if feather_edges) |
| smart_feather_pixelsopt | INT | 320–256 | [smart] feather pixels |
| smart_blend_modeopt | COMBO | Box Feather | [smart] Box Feather softens the crop's rectangular edge. Mask Feather blends along the mask itself, which keeps untouched detail outside the subject. Hard Paste shows the seam and is for checking alignment. |
| smart_resize_full_image_outputopt | COMBO | Restore Original Size | [smart] Only applies when the crop node ran in 'Resize Full Image' mode. |
| smart_enable_color_matchopt | BOOLEAN | false | [smart] Pull the crop's exposure and cast toward the plate before blending. A feathered seam turns a small mismatch into a visible halo instead of hiding it. |
| smart_color_match_amountopt | FLOAT | 0.350–1 | [smart] color match amount |
| context_crop_paddingopt | FLOAT | 1.201–2 | [context blend] How far around the mask's box (x its size) colour match and lightness rescue look for reference colours when color_reference = around mask. |
| context_blend_softnessopt | FLOAT | 8.00–200 | [context blend] Gaussian feather radius applied to the blend mask in pixels. |
| context_mask_expansion_blendopt | INT | 0-100–100 | [context blend] Per-blend dilate (positive) / erode (negative) of the blend mask in pixels. |
| context_enable_color_correctionopt | BOOLEAN | true | [context blend] Reinhard mean/std color match between original and inpainted regions. |
| context_enable_lightness_rescueopt | BOOLEAN | true | [context blend] Lift CIE LAB L-channel of the inpaint when it is more than ~5% darker. |
| context_enable_differential_diffusionopt | BOOLEAN | false | [context blend] Use |orig - inpaint| as a soft preservation weight to keep unchanged pixels. |
| context_sampling_mask_blur_sizeopt | INT | 210–201 | [context blend] Kernel size (odd) for the additional blur on the output debug mask. |
| context_sampling_mask_blur_strengthopt | FLOAT | 1.000–1 | [context blend] Blend factor for the sampling mask blur applied to debug_mask. |
| context_color_referenceopt | COMBO | inside mask (same subject) | [context blend] Where colour match / lightness rescue take their target colours. inside mask = the original pixels under the mask (re-rendering the same face or subject). around mask = the ring between the mask and its box grown by crop_padding (removing an object: match the background, not the thing removed). |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| blend_mask_used | MASK | — |
| info | STRING | — |