Nodes/ComfyUI-Easy-Media/Merge Videos From Paths
ComfyUI Node

Merge Videos From Paths

Merge Every Segment on Disk Without Re-Adding Them by Hand

By yolain·Created 3 months ago·Updated about 17 hours ago· 158
Merge Videos From Paths
  • audio
  • VIDEO
paths
frame_count-1
audio_modemerge

When your clips already live on disk

easy mergeVideos is great when the clips are in your graph as VIDEO objects. But a lot of real workflows generate segments, save them to output/, and then need to join them - or they're pulling in footage that was never in the graph at all. That's the gap easy mergeVideosFromPaths fills: you give it a list of file paths (or URLs), it loads them, concatenates them, and hands you one VIDEO. The README spells out the whole use case: multi-segment generation stitched back into a finished clip.

It's the same "all clips must share fps, dimensions, and audio configuration" rule as its sibling, with one extra trick: it can trim the merged result and attach or replace audio, both via FFmpeg.

How it works

  • Path parsing. The paths input takes one path per line (or comma-separated). It resolves ComfyUI's own input/, output/, temp/ directories, supports subdirectories and ** globs, accepts absolute local paths, and even fetches HTTP(S) URLs.
  • Load and concat. Each path is loaded as a VIDEO and concatenated in order - same tensor-based concat as easy mergeVideos.
  • Optional audio pass. Connect an audio input and, depending on audio_mode, it either merges the new audio with the clip's existing soundtrack or overrides it entirely, using FFmpeg.
  • Optional trim. frame_count defaults to -1, which keeps every frame. Set it above zero and the node computes the duration from the merged video's frame rate and trims the tail with FFmpeg.

The inputs that matter

  • paths - the workhorse. Glob support is the killer feature: output/segments/seg_*.mp4 or output/shots/**/*.mp4 grabs a whole batch in one string. A single path works too (it just loads and returns that video, with any audio/trim applied).
  • frame_count - -1 = all frames; otherwise max frames to keep after merging.
  • audio_mode - merge (default) or override, for how the optional audio input combines with the video's existing audio.
  • audio - optional AUDIO to add or replace.

The single output is VIDEO - merged, trimmed, and with the right soundtrack.

Setup and the traps

Pack install (Manager → ComfyUI-Easy-Media, or git clone + restart), and FFmpeg on your PATH - it's needed for the trim and audio-attach paths, and the pack's README recommends it before anything else. This node is one of the reasons why.

Where it bites:

  • Same-format rule still applies. Mixing a 512x512@30fps render with a 768x768@24fps one errors out on compatibility, exactly like the in-graph merge. Globs make it easy to accidentally sweep mismatched files into one merge - check your segment settings before you glob.
  • Glob surprises. ** is recursive; a broad pattern can pull in files you didn't intend (including that reference clip you saved into the same folder). When the merged video comes out weird, list what the pattern actually matched.
  • URL loads are slow and un-guaranteed. HTTP(S) paths are supported, but each is downloaded before merging; a flaky link turns a 5-second node into a timeout.
  • frame_count trims the merged tail, not per-clip. If you want each segment cropped to a length first, that's a different tool.

When your workflow saves per-segment clips and you're tired of dragging them back into the canvas, this node is the shortcut. Type the folder, merge, done.

CategoryEasyUse/Video

Inputs (4)

NameTypeDefaultDescription
pathsSTRINGOne path per line (or comma-separated). Accepts ComfyUI input/output/temp paths (including subdirectories and ** globs), absolute paths, or URLs.
frame_countINT-1Maximum frames to keep after merging. Use -1 to keep all frames.
audio_modeCOMBOmergeMerge the AUDIO input with the video's existing audio, or override it.
audiooptAUDIOOptional audio to replace or add to the final merged VIDEO using FFmpeg.

Outputs (1)

NameTypeDescription
VIDEOVIDEO