PC Video Mask Stitcher
The node that puts your video back together
- original_images
- processed_images
- cropped_masks
- bboxes
- IMAGE
"PC Video Mask Stitcher" is the second half of the crop-and-stitch trick this pack sells. The smooth crop node cuts a tracking box out of every frame so your inpaint or face-swap model can work on a small region at proper resolution. This node puts the processed crop back onto the original frame - and it's the half that decides whether the result looks like video or like a stamp stuck on a screenshot.
Why you even need a dedicated stitcher: the whole point of crop-and-stitch video inpainting is that nothing outside the mask changes. Whole-frame edit models shift the background a bit every pass, and across a video that drift compounds into shimmer. Stitch back with a hard rectangular paste and you get a visible seam - the box edge is usually a different brightness or texture than the untouched background. This node's job is to composite the AI result back in so the seam is invisible and the rest of the frame is bit-identical to the original.
How it works
Straightforward, and the code is easy to read if you want to verify. For each frame it takes your original as a canvas, warps the processed crop into the position your bounding box says it belongs (a perspective transform from the bbox corners), and warps the cropped mask the same way to use as an alpha channel. Then it does two sensible things a naive paste skips. First, it erodes the alpha by a pixel inside the bbox so the composited region can't bleed past where the mask actually was - this was an actual bug in the pack's early version, the masked area slipping outside its own box, and it's fixed here. Second, it applies a Gaussian blur to the alpha by your feathering so the blend edge is soft instead of a knife cut.
The inputs that matter
original_images- the untouched frames. This is the canvas; everything outside the composite stays exactly as it was.processed_images- your AI-modified crops (the output of your inpaint/swap step).cropped_masks- the masks you cropped, used as the blend boundary.bboxes- the BBOX list from the smooth crop node, telling it where each crop goes.feathering- edge softness in pixels, default 10. Zero gives a hard edge; too high bleeds the change into the background.
One output: IMAGE, the finished frames, ready to be saved or fed to a video encoder.
How to wire it
The order is: masks → PC Video Mask Smooth Crop → your inpaint/face-swap model on the crops → PC Video Mask Stitcher → save video. The bboxes route straight from the crop node to the stitcher - they're the same BBOX type Impact Pack popularized, so they're easy to inspect or pass through other detection nodes if you're curious what box was actually used.
How to install
ComfyUI Manager: search "PCVideoMask". Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/pavelchezcin/pcvideomask ComfyUI-PCVideoMask
Restart and you're done. No models to grab. The pack lists no Python dependencies but imports OpenCV, so if the node errors at startup and cv2 is missing from your environment, pip install opencv-python in your ComfyUI venv fixes it.
Gotchas
Both image batches need the same frame count - the node composites min(original, processed) frames and truncates silently if they drift. And feathering is your seam-control knob; if you see a visible rectangle outline, nudge it up; if you see a smeared halo around the subject, take it back down. Small pack, single maintainer, and its lane is specifically video inpaint crop-and-stitch - but for that lane it does exactly what it says, and the bit-identical background is the payoff that makes it worth reaching for.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| original_images | IMAGE | — | |
| processed_images | IMAGE | — | |
| cropped_masks | MASK | — | |
| bboxes | BBOX | — | |
| feathering | INT | 100–128 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |