Nodes/Simple Video Effects/Advanced Folder Video Combiner
ComfyUI Node

Advanced Folder Video Combiner

Turn a folder into one edited video

By scofano·Created 10 months ago·Updated 20 days ago· 0
Advanced Folder Video Combiner
  • music_track
  • output_path
directory_path
output_filenamecombined_output.mp4
file_pattern*.mp4
clip_duration5.0
width1080
height1920
resize_modecrop
resize_padding_color#000000
transitionfade
transition_duration0.5
sort_filesfalse
random_ordertrue
seed-1
trim_to_audiotrue
fade_in_enabledtrue
fade_in_color#000000
fade_in_duration0.5
fade_out_enabledtrue
fade_out_color#000000
fade_out_duration0.5
use_gputrue

The simple version of this pack's combiner just concatenates the MP4s in a folder. This one is the "make me an actual edit" version: it takes every video in a directory, normalizes them to one resolution and FPS, splices them with crossfades, adds fade-in/fade-out from a color, optionally mixes in a music track, and writes out a single finished video. It's the node you reach for when you've batch-rendered a pile of clips and want a compilation with transitions without touching a timeline editor.

It wears its inspiration on its sleeve - the README credits DarioFT's ComfyUI-VideoDirCombiner - and it's a genuinely configurable little editor: alphabetical or randomized order (with a seed), no repeated clips, per-clip trimming, resolution normalization with crop-or-pad, and audio handling that accepts VideoHelperSuite's audio format.

The default that will surprise you

Before the inputs, the one thing to fix: width defaults to 1080 and height to 1920 - portrait. Every clip gets normalized to that. If your videos are landscape, change width/height to 1920×1080 (or whatever matches) on your first run, or your "compilation" comes out vertical. Also note random_order defaults to true and sort_files to false, so out of the box it shuffles your clips. Both defaults are easy to miss and both change the result dramatically.

Inputs that matter

  • directory_path, output_filename, file_pattern (default *.mp4) - what to combine and what to call it.
  • clip_duration - random segment length in seconds (0 = full video, default 5).
  • width / height / resize_mode (crop or padding) / resize_padding_color - the normalization target. Crop trims to fill; padding letterboxes with the hex color.
  • transition (none/fade) and transition_duration - crossfade between clips.
  • Optional: sort_files, random_order, seed, music_track (AUDIO - a VideoHelperSuite audio object or a path), trim_to_audio, fade_in_enabled/fade_in_color/fade_in_duration, fade_out_enabled/fade_out_color/fade_out_duration, use_gpu.

The single output output_path is the path string to the finished video.

How it works

Internally it probes every clip's duration in parallel (ThreadPoolExecutor), detects the first clip's resolution/FPS as the reference, then builds an ffmpeg complex filter graph: chained xfade transitions between clips, color sources for the fades, fps/size normalization on each segment, and amix for the music. Music in VideoHelperSuite's tensor form (waveform + sample rate) is written to a temp WAV first via soundfile, then mixed in. Temporary files are cleaned up automatically, and fades clamp so they never exceed clip length.

Installing it

Ships with the Simple Video Effects pack:

cd ComfyUI/custom_nodes
git clone https://github.com/scofano/ComfyUI-Simple-video-effects
cd ComfyUI-Simple-video-effects
pip install -r requirements.txt

Restart ComfyUI, or install via ComfyUI Manager ("Simple Video Effects"). No models. Heavy ffmpeg user - keep the binaries on your PATH.

Common issues

Besides the portrait-default trap, the usual suspects: a clip_duration of 0 means "use full clips" while 5 means 5-second random slices, so long clips get cut to 5s unless you change it; music_track needs an actual VideoHelperSuite AUDIO object or a valid path or it bails; and fade/transition durations longer than a clip get auto-clamped (by design). If your output has timing problems, check that all source clips share a sensible FPS - the node normalizes, but wildly mixed FPS sources (24/30/60) can still produce the occasional odd frame.

CategorySimple Video Effects

Inputs (22)

NameTypeDefaultDescription
directory_pathSTRING
output_filenameSTRINGcombined_output.mp4
file_patternSTRING*.mp4
clip_durationFLOAT5.00–3600
widthINT10801–8192
heightINT19201–8192
resize_modeCOMBOcrop2 options: crop, padding
resize_padding_colorSTRING#000000
transitionCOMBOfade2 options: none, fade
transition_durationFLOAT0.50.1–2
sort_filesoptBOOLEANfalse
random_orderoptBOOLEANtrue
seedoptINT-1-1–2147483647
music_trackoptAUDIO
trim_to_audiooptBOOLEANtrue
fade_in_enabledoptBOOLEANtrue
fade_in_coloroptSTRING#000000
fade_in_durationoptFLOAT0.50.1–10
fade_out_enabledoptBOOLEANtrue
fade_out_coloroptSTRING#000000
fade_out_durationoptFLOAT0.50.1–10
use_gpuoptBOOLEANtrue

Outputs (1)

NameTypeDescription
output_pathSTRING