Nodes/ComfyUI-VideoDirCombiner/Video Directory Combiner
ComfyUI Node

Video Directory Combiner

Stitch every clip in a folder into one video, fades and soundtrack included

By DarioFT·Created 2 years ago·Updated about a year ago· 8
Video Directory Combiner
  • music_track
  • STRING
directory_path
output_filenamecombined_output.mp4
file_pattern*.mp4
transitionnone
transition_duration0.5
sort_filestrue

You've just generated thirty Wan clips and you need them as one video. That's the exact gap this node fills: point it at a folder, and it glues every matching video into a single file - optionally with a fade between clips and a background music track on top. It's a small utility from a small pack (DarioFT/ComfyUI-VideoDirCombiner), and that's honestly its appeal. No model downloads, no VRAM cost, just ffmpeg doing the boring work you'd otherwise do in a terminal.

What it actually does

Under the hood it's a thin wrapper around ffmpeg, and the two transition modes work very differently:

  • transition = "none" uses the concat demuxer with a file list and -c copy, meaning the video stream is copied without re-encoding. That's fast and quality-preserving - but it only works cleanly when your clips share the same codec, resolution, and framerate. Mix a 1080p60 clip with a 720p30 one and ffmpeg will either error out or produce glitches at the seams.
  • transition = "fade" re-encodes using ffmpeg's xfade filter, chained together for more than two clips with offsets computed from each clip's probed duration. This is the mode for mismatched clips since it actually re-renders the whole thing - but the README's tip about "similar resolutions and framerates" still applies, because xfade is picky.

The music track is the clever part. ComfyUI's AUDIO type (the one VideoHelperSuite's LoadVideo outputs) is just a dict holding a torch waveform and a sample rate. This node converts that to a WAV in a temp file, then muxes it in with -shortest, so the final file ends when whichever is shorter - video or music - runs out. It also cleans up its temp files and drops the finished video in ComfyUI's output folder.

The inputs that matter

Most of the fields are self-explanatory, but a few deserve attention:

  • directory_path - the folder to scan. The node globs it, so a bad path raises a clear error rather than silently doing nothing.
  • output_filename (default combined_output.mp4) - where the result lands, relative to ComfyUI/output. Give it something unique per run or you'll overwrite last batch.
  • file_pattern (default *.mp4) - you can grab *.mov or *_final.mp4; whatever you're batch producing.
  • transition and transition_duration - none vs fade, duration clamped 0.1–2.0s.
  • sort_files - alphabetical ordering, on by default. Leave it on unless your filenames already encode the right order, or you'll get surprise ordering.
  • music_track - only usable if you have VideoHelperSuite installed, because that's what defines the AUDIO type on the port. No VHS, no music.

The single output is a STRING - the filesystem path of the combined file. This node is an output node, so it doesn't stream the result back into your graph; wire that path into a preview node or just open it from ComfyUI/output.

Installing it

No models, no heavy deps - just ffmpeg-python and an ffmpeg binary on your PATH. Either install via ComfyUI Manager (search "ComfyUI-VideoDirCombiner") or:

cd ComfyUI/custom_nodes/
git clone https://github.com/DarioFT/ComfyUI-VideoDirCombiner

Then restart ComfyUI. If you plan to use the music feature, install VideoHelperSuite too - the node depends on its AUDIO type.

Where people get burned

The #1 failure mode isn't the node, it's ffmpeg missing from your PATH - ComfyUI's bundled Python won't help you here. Most of the other grief is video mismatch: stream-copy concat breaks on mixed codecs, and xfade hates mismatched resolutions. Feed it a folder of like-for-like clips (which is what you're batch-generating anyway) and it just works. Don't expect a preview or a progress bar - it's a fire-and-forget terminal-style tool wrapped in a node, which is exactly right for the batch workflow.

Categoryvideo

Inputs (7)

NameTypeDefaultDescription
directory_pathSTRING
output_filenameSTRINGcombined_output.mp4
file_patternSTRING*.mp4
transitionCOMBOnone2 options: none, fade
transition_durationFLOAT0.50.1–2
sort_filesoptBOOLEANtrue
music_trackoptAUDIO

Outputs (1)

NameTypeDescription
STRINGSTRING