凤希AI - 视频合并
Stitch your segments back into one video, fast
- 音频
- 视频本地路径
FxAiVideoMerger ("凤希AI - 视频合并") is the payoff node of the whole segmented-generation system. You generate dozens of short segment mp4s one at a time (that's how you fit a long video on a small GPU), and this node stitches them back into one continuous video. It's the closing bracket of the loop - without it you'd have a folder full of numbered clips and no movie.
What it does
Point it at the folder where your segments live, tell it how many files to include and what to name the result, and it:
- Gathers the video files in that folder.
- Writes a
merge_list.txt(ffmpeg's concat list format) into the source folder. - Runs ffmpeg's concat demuxer with
-c:v copy- that's a stream copy, meaning no re-encoding. This is fast and lossless; it takes seconds even for many segments, because it's just remuxing. - Optionally muxes a fresh AUDIO track over the result (the segments' own audio gets replaced, and the new audio is converted to WAV and mixed in).
- Saves the final file as
ComfyUI/fxai/video/merged/<名称前缀>_YYYYMMDD_HHMMSS.mp4- the timestamp guarantees no clobbering.
The single output is 视频本地路径 (STRING) - wire it into FxAiVideoPreview and you'll see the finished movie without leaving ComfyUI.
The inputs that matter
- 源视频文件夹路径 - STRING, required. The folder containing your segment files. Wire it from FxAiVideoManager's 文件夹路径 output so it always matches where the generators wrote.
- 文件数量 - INT, default 1. How many files to merge. The files are gathered in sorted order, so
12merges the first 12 segments. This is your "merge everything so far" dial - bump it as segments accumulate. - 名称前缀 - STRING, default
"fxai". The base of the output filename. - 音频 - optional AUDIO socket. Provide a full-length track to replace the segment audio.
There's also a 刷新标记 INT input - a force-input you can tick to force a re-merge.
The gotcha that bites everyone once
Because it uses -c:v copy (the concat demuxer, not the concat filter), all segments must share the same codec, resolution, and frame rate - otherwise ffmpeg refuses or produces a corrupt file. That's automatic when you generate segments with this pack's own video generators (same encoder settings every time), which is exactly why the pack gets away with stream copy. But if you throw in external clips - a different camera file, a download - the merge will fail or glitch. The fix is to re-encode mismatched sources to match first, not to blame the merger.
Also note: it writes merge_list.txt into your source folder. Harmless, but it'll show up in folder listings, and the merger's own file-scan will pick up videos only, so it won't pollute the count.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/fxai666/fxai-toolkit
Restart ComfyUI, or use ComfyUI Manager and search "fxai-toolkit". Needs system ffmpeg (unlike the generator, this node doesn't suppress stderr, so a failure at least tells you why). No model downloads.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| 源视频文件夹路径 | STRING | — | |
| 文件数量 | INT | 1 | — |
| 名称前缀 | STRING | fxai | — |
| 刷新标记opt | INT | — | |
| 音频opt | AUDIO | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| 视频本地路径 | STRING | — |