Gift Mask Blend · 序列融合
Two frame sequences, one smooth crossover, zero fiddly math
- first_images
- second_images
- mask
- images
GiftMaskBlend is the node for the most annoying job in sequence work: crossfading two animation clips into each other at a chosen frame. The straightforward way to do this in ComfyUI involves resizing, cropping, premultiplying, aligning batches, and praying the alpha lines up. This node takes two IMAGE sequences and a mask and does the whole crossover in one shot, and it's engineered to absorb the little mismatches that usually break this operation.
How it works
You give it first_images, second_images, a mask, and blend_start - the frame in the first sequence where the crossover begins. From that frame on, the first sequence fades out through the mask while the second fades in from its first frame. The mask is a per-pixel opacity map: at blend_start, the output is first × mask + second × (1 − mask), per pixel, per frame. Because it's a spatial mask, it's not just a crossfade - you can blend only part of the frame, or use a mask that animates, which is how you'd do a wipe or a region-specific transition.
Three accommodations make it worth using over DIY compositing:
- Short mask handling - if your mask batch is shorter than the first sequence, the last mask frame is repeated for the remainder. No shape errors, no silent garbage.
- Auto alignment -
second_imagesis resized and channel-aligned to the first sequence automatically (including 3↔4 channel conversion). Feed it mismatched resolutions and it just works instead of failing. - Length balancing - if the second sequence runs longer than the overlap, its tail frames pass through untouched; if it's shorter, the first sequence's post-blend frames keep their masked opacity.
Outputs and the workflow it slots into
One output, images, at the length of the first sequence (with the second sequence contributing only during overlap). It doesn't modify either input - that matters, because the suite's older mask-blend code had a bug where upstream masks got mutated in place; these nodes were rewritten to be collision-safe and leave inputs alone.
Where you'll actually use it: gift animation production, which is this pack's home turf. You generated clip A and clip B, and you want A to hand off to B at a specific beat - feed a GiftMaskRamp output as the mask, set blend_start, done. It's also the natural landing point after GiftFrameSlice trims the sequences down.
Install and migration
ComfyUI Manager (search "ComfyUI-GiftHelperSuite") or git clone https://github.com/lingziwyh/ComfyUI-GiftHelperSuite.git into custom_nodes, restart. No pip deps. This node is the successor to SequenceOverlayNode from the old standalone mask-blend plugins - swap the type in old workflows (SequenceOverlayNode → GiftMaskBlend), then disable the old folders, since the two legacy ComfyUI-mask-blend* packs conflict with each other.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| first_images | IMAGE | — | |
| second_images | IMAGE | — | |
| mask | MASK | — | |
| blend_start | INT | 00–100000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |