Nodes/ComfyUI_Swwan/Image Batch Join With Transition (Swwan)
ComfyUI Node

Image Batch Join With Transition (Swwan)

Slide, wipe or iris between two clips

By aining2022·Created 12 months ago·Updated 4 days ago· 40
Image Batch Join With Transition (Swwan)
  • images_1
  • images_2
  • IMAGE
◄start_index0►
◄interpolation▾►
◄transition_type▾►
◄transitioning_frames1►
◄blur_radius0.0►
◄reversefalse►
◄deviceCPU►

A real transition, not a dissolve

Cross Fade Images dissolves. This node wipes: the boundary between clip A and clip B sweeps across the frame - horizontally, vertically, as a growing box, as an expanding circle, as a pair of doors, or as a plain fade. If you've ever wanted a circle iris between two generated shots without opening a compositor, this is it.

KJNodes' ImageBatchJoinWithTransition under a Swwan ID, and it's the most capable node in the pack's transition group - which is also why every knob on it matters.

How the wipe works

For each blended frame the node builds a mask rather than mixing whole images: the shape's edge is placed according to the eased alpha, and then the frame is images_1 * (1 - mask) + images_2 * mask. Same maths as a cross fade, different mask. horizontal slide fills the mask from the left, vertical slide from the top, box grows a centred rectangle, circle grows a radius from the centre, the two door modes fill bars in from both edges, and fade just sets the mask to alpha everywhere - which is the dissolve you'd get from the other node.

blur_radius (0 to 100, default 0) Gaussian-blurs that mask before it's applied, which is the soft-edge feather. A couple of pixels of blur turns a hard-edged wipe into something that reads as motion rather than a cut.

And interpolation shapes the timing of the sweep: linear moves at a constant rate, ease_in_out starts slow, accelerates, and settles, and the hyperbolic ones (bounce, elastic, glitchy) wobble. On a wipe, timing is most of the perceived polish.

Inputs and output

Required: images_1, images_2, start_index, interpolation, transition_type, transitioning_frames, blur_radius, reverse, device. That's the full required list, and all of them are widgets - only the two batches are wires.

  • start_index - default 0, and it can go negative: -10000 to 10000. It's where in images_1 the transition begins. Negative values count back from the end.
  • transitioning_frames - default 1, minimum 1. How long the wipe lasts.
  • reverse - swaps which clip is treated as the one being transitioned from, both in the timing and inside the wipe maths.
  • device - CPU or GPU, default CPU. With GPU, each frame pair is moved to the device for the wipe and moved back, then the whole result is stacked on CPU.

Output: a single IMAGE containing images_1[:start_index], the blended frames, and the remainder of images_2.

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. No models, no optional packages - it's tensor masking, with an optional GPU hop for speed.

Where it bites

The transition can be shorter than you asked. The number of blended frames is the minimum of transitioning_frames, the frames left in clip A after start_index, and the length of clip B. Ask for 24 frames when clip B only has 12 and you get 12, no warning. Check your clip lengths first - Get Image Range From Batch and the size/count nodes are there for exactly that.

Both batches must be non-empty - Both input batches must have at least one image is the error - and the frames need matching dimensions, since the blend is element-wise. Cross-fading a 720p clip into a 1080p one needs a resize first.

start_index out of range raises, rather than clamping. start_index = -10000 on a 60-frame clip is the same as -60 is the same as 0; anything past that is an error you'll have to read.

Blur is applied per frame, on the whole mask. A large blur_radius at low transitioning_frames gives you a wipe that's mostly blur and barely a wipe - if it looks mushy, cut the blur and extend the frame count instead. And unlike the pack's cross-fade node, this one always produces a visible transition: at transitioning_frames = 1 you get a single hard-edged frame, which is a legitimate cut-with-a-chip of the wipe, not a no-op.

One last thing: it's a wipe of whole frames, not a moving subject. Nothing here tracks content, so a horizontal slide on two unrelated clips looks like a PowerPoint transition - which is fine, and occasionally exactly the energy you want.

CategorySwwan/Advanced/Batch

Inputs (9)

NameTypeDefaultDescription
images_1IMAGE—
images_2IMAGE—
start_indexINT0-10000–10000—
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_framesINT11–4096—
blur_radiusFLOAT0.00–100—
reverseBOOLEANfalse—
deviceCOMBOCPU2 options: CPU, GPU

Outputs (1)

NameTypeDescription
IMAGEIMAGE—