Wanv2v: Mix Color By Mask
Tint a whole batch of frames through a mask without blowing up VRAM
- image
- mask
- IMAGE
MixColorByMaskBatched is the odd one out in this pack: it has nothing to do with stitching. It's a batch-savvy port of a classic image trick - blend a flat color into a frame through a mask - and it drops into the "Masquerade Nodes" section of your menu because that's where that classic lives. If you've used the single-image version, you know the drill: out = image × (1 − mask) + color × mask. This one does it for an entire video frame batch, in slices, so you don't OOM on a 300-frame clip.
Inputs: image (IMAGE batch), r, g, b (0–255, the color you're blending in), mask (an IMAGE, notably - not the MASK type - the node uses its first channel), batch_size (8), and repeat_image (false/true). Output is the tinted IMAGE batch, same length as the mask batch.
The mechanism is exactly that formula with the color normalized to 0–1, run in chunks of batch_size frames. The repeat_image toggle is the one that does something interesting: if you have a single image and a multi-frame mask, set it to true and the node repeats that one image to match the mask count. That's the pattern for "same background, different masked regions per frame" - tint each region differently without regenerating the base.
Where you'd actually use this in a video pipeline: color grading a region through a matte, tinting control frames before they hit the sampler, or building colored conditioning masks. It's a utility node, not a star, and the pack treats it that way - the README never even mentions it.
The gotcha is a batch-mismatch one, and it's real in the source: the auto-repeat only fires when the image batch has exactly one frame. If your mask batch is longer than your image batch and the image has more than one frame, the node slices past the end of the image tensor and you get a shape mismatch instead of a graceful message. The safe rule: keep mask count ≤ image count, or use a single image with repeat_image set to true. Match your counts and it's boring in the best way.
Install is the pack standard:
cd ComfyUI/custom_nodes
git clone https://github.com/Kishor900/comfyui-wanv2v-video-stitcher
Restart ComfyUI and it appears under Masquerade Nodes (ComfyUI Manager: search "ComfyUI WANv2v Video Stitcher"). No extra dependencies - it's pure torch, which makes it the least likely node in this pack to break on you.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| r | INT | 00–255 | — |
| g | INT | 00–255 | — |
| b | INT | 00–255 | — |
| mask | IMAGE | — | |
| batch_size | INT | 81–4096 | — |
| repeat_image | COMBO | 2 options: false, true |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |