Nodes/ComfyUI_Swwan/Cross Fade Images Multi (Swwan)
ComfyUI Node

Cross Fade Images Multi (Swwan)

Chain five clips with fades between them

By aining2022·Created 10 months ago·Updated about 18 hours ago· 33
Cross Fade Images Multi (Swwan)
  • image_1
  • image_2
  • IMAGE
◄inputcount2►
◄interpolation▾►
◄transitioning_frames1►

Chain, don't hand-stitch

Cross Fade Images handles two clips. This one handles N: you set inputcount, wire up image_1, image_2, image_3… and it walks the list, inserting a fade between the last frame of what it's accumulated so far and the first frame of the next input, then appending that input's frames. One batch out, cut points softened, no compositor.

It's the KJNodes node of the same name, re-registered by the Swwan pack. If your project is "twenty shots, one continuous assembly", this is the difference between one node and nineteen.

The mechanism, and the two bugs-to-be-aware-of

For each additional input the node takes the last frame of the accumulated batch and the first frame of the new input, generates transitioning_frames frames between them using crossfade = (1 - alpha) * last + alpha * first with alpha passed through your chosen interpolation, and then appends the entire new batch after those frames.

That "entire" is worth knowing: the new clip's first frame appears both as the end of the fade and as the start of the appended clip. It's a duplicate frame. On fast cuts nobody notices; on a slide-y dissolve it's a one-frame hitch you'll chase for an hour.

Two sharper edges, both from reading the actual implementation rather than the description:

transitioning_frames = 1 will throw ZeroDivisionError. The node computes t = frame / (transitioning_frames - 1) inside the loop, and with a single frame that's 0/0. Since 1 is also the widget default, you can load this node, connect nothing but the images, and get a division-by-zero on the first run. Set it to 0 to skip the fade entirely (the loop doesn't execute) or 2+ for a real one. This is the bug that makes people think the pack is broken.

Unconnected inputs become black frames. Inputs you declared with inputcount but didn't wire fall back to a tensor of zeros. With inputcount = 4 and three clips patched in, you get a fade into black and back. The dynamic-input frontend script keeps inputcount honest about how many sockets exist, but it can't know which ones you meant to leave empty.

Inputs and outputs

  • inputcount - 2 to 1000, default 2. Changing it adds/removes sockets, and the pack's own frontend script won't shrink below your highest connected socket, so it can't silently eat a wire you're using.
  • image_1 - required, and this is a batch: the node reads its last frame as the fade-out. A single image counts as a one-frame batch, so the "last frame" is the whole thing.
  • image_2 (optional input, plus image_3… as you raise the count) - the frames being faded into.
  • interpolation - linear, ease_in, ease_out, ease_in_out, bounce, elastic, glitchy, exponential_ease_out. linear or ease_in_out for anything you want to look professional.
  • transitioning_frames - 2 or more. See above.

Output: IMAGE, one continuous batch. Feed it to a video combine node or Save Image.

The node resizes mismatched inputs to image_1's width and height with Lanczos before blending, which is more forgiving than the two-input version - you won't get a hard error from a slightly different resolution, you'll get a soft one. Keep the sizes consistent anyway; upscaling a clip to match a larger one looks exactly as bad as it sounds.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/aining2022/ComfyUI_Swwan
cd ComfyUI_Swwan
python -m pip install -r requirements.txt

Manager → ComfyUI Swwan. Restart and hard-refresh; the dynamic input sockets come from a JS extension in the pack, so a stale browser cache can leave you with a node whose inputcount doesn't add sockets. If raising the count does nothing, that's the frontend script not loading - force-refresh the page and check the network tab for /extensions/ComfyUI_Swwan/.

No models, no optional deps.

CategorySwwan/Advanced/Image

Inputs (5)

NameTypeDefaultDescription
inputcountINT22–1000—
image_1IMAGE—
interpolationCOMBO8 options: linear, ease_in, ease_out, ease_in_out, bounce, elastic, +2
transitioning_framesINT10–4096—
image_2optIMAGE—

Outputs (1)

NameTypeDescription
IMAGEIMAGE—