🔥VideoTransition
Crossfades and wipes between two clips, the xfade way
- video_complete_path
VideoTransition stitches two clips together with an actual transition effect - fade, wipe, slide, circle, pixelize, and a couple dozen more - instead of just hard-cutting from one to the other. If you're assembling a short film out of AI-generated shots, this is the polish step that makes it feel like something edited rather than something queued. It's a direct wrapper around FFmpeg's xfade filter, which is exactly why the transition list behaves a little oddly (more on that below).
How it works
Both videos are normalized first - scaled to the reference video's dimensions (letterboxed with black bars if the aspect ratios differ), forced to its fps, and converted to yuv420p - then run through xfade at the offset you choose. When both inputs have audio it goes the extra mile: it crossfades the two soundtracks with acrossfade instead of just chopping them. That's genuinely nicer than most DIY ffmpeg one-liners.
The inputs that matter
- video1_path / video2_path - video1 plays first, then the transition into video2.
- reference_video -
video1orvideo2; this decides the output resolution and frame rate. Both clips get resized to it. - transition - the effect. Here's the weird part: the dropdown is populated at runtime by actually running
ffmpeg -h filter=xfadeon your machine, so the list you see is whatever your FFmpeg build supports. If an effect you were promised is missing, that's your FFmpeg version, not the node. - transition_duration - how long the crossfade lasts, min
0.1s, hard cap3s. - offset - the point (in seconds) in video1 where the transition starts. The node enforces that
offsetmust be less than video1's duration minus the transition duration, and will error out with a math-y message if you violate it.
Outputs
Just one: video_complete_path, the timestamped path of the finished render.
Install
Pack-wide story, one more time: FFmpeg on PATH is the real requirement, the Python dependency is a rounding error. Manager search "ComfyUI-FFmpeg", or:
cd ComfyUI/custom_nodes
git clone https://github.com/MoonHugo/ComfyUI-FFmpeg
cd ComfyUI-FFmpeg
pip install -r requirements.txt
Restart and you're in.
Gotchas
- The output file auto-names with a timestamp - every render is a new file, which is either nice (no accidental overwrites) or annoying (disk clutter) depending on how many takes you're doing.
- If the
transitiondropdown comes up empty, your FFmpeg build either lacks the xfade filter or isn't on PATH - checkffmpeg -h filter=xfadein a terminal yourself. If that command errors, fix FFmpeg before touching this node. - This is a full re-encode (both streams go through the filter graph), so it's slow-ish for long clips. A 10-second pair of shots is fine; a 20-minute pairing will feel like it's hanging. It's not - ffmpeg is just working.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| video1_path | STRING | C:/Users/Desktop/video1.mp4 | — |
| video2_path | STRING | C:/Users/Desktop/video2.mp4 | — |
| reference_video | COMBO | video1 | 参考视频是哪个视频,决定了输出视频的尺寸和帧率!(Reference video is which video, determines the size and frame rate of the output video!) |
| device | COMBO | cpu | 2 options: cpu, cuda |
| transition | COMBO | fade | 43 options: circleclose, circlecrop, circleopen, diagbl, diagbr, diagtl, +37 |
| transition_duration | FLOAT | 1.00.1–3 | 转场持续时间,单位秒,最大值为3秒,不能小于0.1秒!(Transition duration, in seconds, the maximum value is 3 seconds, cannot be less than 0.1 seconds!) |
| offset | FLOAT | 1.0 | 转场开始时间,单位秒,不能大于等于视频1的时长减去转场持续时间(transition_duration)!(Transition start time, in seconds, cannot be greater than or equal to the duration of video1 minus the transition duration (transition_duration)!) |
| output_path | STRING | C:/Users/Desktop/output | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| video_complete_path | STRING | — |