Gift Mask Fade In-Out · 首尾淡入淡出
Fades at both ends of a sequence, without touching your mask
- images
- input_mask
- images
- mask
GiftMaskFadeInOut is the tiny but essential node that fades a sequence in at the start and out at the end, symmetrically. Gift animations and short clips almost always need this - elements should ease in, play, then vanish - and doing it by hand means building a frame-indexed envelope, multiplying it into a mask, and getting the math wrong at least once. This node takes the sequence and a frame count and does it in one step.
The two inputs that matter
images- your sequence. It's passed through unchanged.fade_frames(default 10) - how many frames the fade spans at each end. The node builds a triangular envelope: it ramps 0→1 over the fade-in, holds at 1, then ramps 1→0 over the fade-out. Set it to 0 and you get an all-opaque mask, which is a valid choice if you just want the pass-through output.
The optional input_mask is the interesting bit. If you don't provide one, the node generates a plain white mask and applies the fade envelope. If you do provide one, your mask is multiplied by the fade envelope - so you get your existing alpha and the temporal fade, without the node modifying your upstream mask. That "don't mutate inputs" guarantee is deliberate: the suite's old standalone mask-blend code had a real bug where it modified input masks in place, and these reimplementations were written specifically to be collision-safe.
Outputs
Two outputs: images (the untouched sequence, so it's safe to chain) and mask (the faded mask). The classic wiring: mask into a compositing or alpha-multiply node, with the same images feeding the foreground. Fade a gift animation in and out cleanly, dissolve a layer at the top of a livestream overlay, or generate the envelope for a GiftMaskBlend crossover - that's the natural trio, and fade_frames does double duty as the crossover duration.
One honest caveat about the symmetric behavior: it's a fade in and a fade out by design, so if you only want a fade-in you'll get an unexpected fade at the tail. That's not a bug, it's the "In-Out" in the name - for an asymmetric ramp, GiftMaskRamp is the tool.
Install is the pack's standard: ComfyUI Manager (search "ComfyUI-GiftHelperSuite") or git clone https://github.com/lingziwyh/ComfyUI-GiftHelperSuite.git into custom_nodes, restart, no pip dependencies. It replaces the old MaskTransparentInOutNode - swap the node type in legacy workflows and disable the old ComfyUI-mask-blend* folders to avoid duplicate-ID conflicts.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| fade_frames | INT | 100–100000 | — |
| input_maskopt | MASK | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |
| mask | MASK | — |