Nodes/ComfyUI_Swwan/Transition Images In Batch (Swwan)
ComfyUI Node

Transition Images In Batch (Swwan)

Wipes and slides between frames you already have

By aining2022·Created 10 months ago·Updated about 18 hours ago· 33
Transition Images In Batch (Swwan)
  • images
  • IMAGE
◄interpolation▾►
◄transition_type▾►
◄transitioning_frames1►
◄blur_radius0.0►
◄reversefalse►
◄deviceCPU►

Take a batch of, say, four images, and turn it into a sequence where each one wipes into the next. A circle opens on image one and image two shows through; a bar sweeps across; the whole thing cross-dissolves. You get the transition frames as an IMAGE batch, ready for Video Combine or for interpolation.

This is a slideshow tool, not a video model. It doesn't generate motion, and it doesn't know what's in your frames - it composites the images you give it and nothing else. But for stitching generated segments into something watchable, or for assembling a set of stills into a short clip that doesn't just cut, it's exactly the right size of tool. The pack inherited it from KJNodes, which in turn credits matteo's essentials nodes for the wipe maths.

How it works

For every adjacent pair in the batch it generates transitioning_frames new frames, then concatenates everything: your first frame, the transition frames, your second frame, the next transition, and so on. Each generated frame is one step further through the wipe.

The wipe itself is a mask with a shape. horizontal slide fills the mask from the left as alpha grows; vertical slide from the top; box grows a centred rectangle; circle grows a radius from the centre; horizontal door and vertical door open from the edges inward; fade sets the mask to the alpha value across the whole frame, which is a plain cross-dissolve. Then it composites images_1 * (1 - mask) + images_2 * mask - so mask 0 is frame one, mask 1 is frame two.

Two things modulate the timing and feel. interpolation picks the easing curve that turns linear progress into something with acceleration: ease_in, ease_out, ease_in_out, exponential_ease_out, and the two show-offs, bounce and elastic, which overshoot on purpose. blur_radius runs a separable Gaussian over the mask before compositing (kernel ~2×radius+1, sigma = radius/3), which is what stops the edge being a razor line - it's the whole difference between "cheap PowerPoint" and "has a bit of craft."

Inputs and outputs

Required: images (IMAGE), interpolation, transition_type, transitioning_frames (INT), blur_radius (FLOAT), reverse (BOOLEAN), device (CPU or GPU). Output: IMAGE - the whole expanded batch.

reverse flips both the frames and the alpha direction, so a wipe that ran left-to-right runs right-to-left. device: GPU moves the working frames onto the torch device for speed; the result comes back on CPU either way, so it's a performance switch, not a memory one. A batch of one image is returned untouched.

Install

Part of aining2022/ComfyUI_Swwan:

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

Restart and refresh; search Swwan. No models, no extra dependencies - the blur is a hand-rolled conv2d, not a scikit-image call, so nothing new loads.

Where people get burned

Transition length multiplies fast. Cost is roughly (batch − 1) × transitioning_frames extra frames, each needing a mask composite and, if you set a blur radius, a Gaussian convolution over that mask. A 10-image slideshow with 30 transition frames and a blur of 40 is a few hundred convolutions - turn device to GPU and keep the blur modest.

transitioning_frames = 1 is a bad value. As the shipped loop is written, it computes progress as frame / (transitioning_frames - 1), which divides by zero at exactly 1. Either leave it at 0 (no transition frames inserted, effectively a cut) or set 2 and up. The default of 1 looks harmless in the widget; if you get a division-by-zero on a multi-frame batch, this is why.

Order is content. The node transitions from each frame to the next in batch order, first to last. If the sequence feels backwards, the frames were backwards - Reverse Image Batch (Swwan) upstream fixes the batch, not the transition.

Frames are stills. A wipe between two unrelated images looks like a wipe between two unrelated images. For continuity, transitions want frames that share lighting and composition - generate them for the purpose, or blend across a short range of an existing clip.

Mixing with Transition Images Multi is a trap. That node transitions between separate wires; this one works on one batch. If your graph needs eight distinct images joined in a specific order, you want the Multi version.

CategorySwwan/Advanced/Batch

Inputs (7)

NameTypeDefaultDescription
imagesIMAGE—
interpolationCOMBO8 options: linear, ease_in, ease_out, ease_in_out, bounce, elastic, +2
transition_typeCOMBO7 options: horizontal slide, vertical slide, box, circle, horizontal door, vertical door, +1
transitioning_framesINT10–4096—
blur_radiusFLOAT0.00–100—
reverseBOOLEANfalse—
deviceCOMBOCPU2 options: CPU, GPU

Outputs (1)

NameTypeDescription
IMAGEIMAGE—