音频拼接
Glue nine clips end to end — and know what it won't fix for you
- 音频1
- 音频2
- 音频3
- 音频4
- 音频5
- 音频6
- 音频7
- 音频8
- 音频9
- 音频
Making one file out of many is the oldest audio edit there is, and in ComfyUI it's still manual labour: a node for each clip, then something that joins them. 音频拼接 (YanhuoAudioConcat) is that "something" - up to nine AUDIO inputs, one AUDIO out, spliced end to end.
When to reach for it
The obvious use is narrative: intro sting, three lines of dialogue, outro, one file for the mux. The less obvious one is fixing pacing - if a TTS engine gave you per-sentence clips and you want them as a single track for a video node, this is the join.
The counter-case is important: if you want to keep the clips individually addressable - auditioning takes, picking the good ones out later - you want a batch, not a concat. That's 音频批次合并 in the same pack. Concat is a one-way door: once the waveforms are joined, there's no index to reach back for take 4.
How it works, and the two things it refuses to do
The node declares nine optional AUDIO ports (音频1…音频9). Wire as few as one; unconnected ports are ignored entirely - under the hood an unconnected optional input never reaches the function, so it can't sneak in as a null.
方向 decides the order. 之后 appends in port order, 1 through 9. 之前 reverses the collected list - so the result reads 9, 8, 7 … 1. That's a one-click fix for the classic mistake of building the splice backwards.
Then the actual work is torch.cat along the time axis. Two consequences follow directly from that:
It does not resample. The output inherits the sample rate of the first connected clip. If clip 3 is 22.05kHz and the rest are 44.1kHz, its samples are still counted at the first clip's rate downstream - which means it plays at the wrong speed and pitch. The node prints a warning to the console and carries on. It's the single most common way to end up with a clip that sounds like a chipmunk, and no error will tell you.
It does not reshape. If one clip is mono and another is stereo, the cat fails and you get a RuntimeError naming channel count and shape as the suspects. That one at least tells you.
Empty input throws 至少需要连接一个音频输入 rather than passing silence through, which is the right call - better a loud failure than a zero-second audio file downstream.
Inputs and outputs that matter
| Port | What it is |
| --- | --- |
| 方向 | 之后 (ports 1→9) or 之前 (reversed) |
| 音频1…音频9 | optional AUDIO, one clip each |
| 音频 (output) | one AUDIO dict, spliced |
The output is a plain single AUDIO, not a list - it plugs into SaveAudio, a video mux node, or anything else expecting one clip. Note that a batch output (from 加载批量音频 or 音频批次合并) is a list, and these nine ports each want a single clip. Wiring a batch straight in isn't the move; split it with 筛选音频 and feed the segments you actually want, or wire the loader's individual tracks.
Install
It's one of 16 nodes in yanhuo-easy-use (category yanhuo, Chinese UI, MIT). ComfyUI Manager → search the pack title → install; or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/yanhuoxunxianren/yanhuo-easy-use
# restart ComfyUI
No pip install: the pack's pyproject.toml lists zero dependencies and everything it imports (torch, numpy, Pillow, av) already ships with ComfyUI. Zero model files to download.
The pack's audio work is done with PyAV. If a future ComfyUI ever dropped it, the loader/saver nodes in this pack would say so by name.
Common issues
Clip 4 plays at the wrong speed. Sample-rate mismatch, warned about in the console and not corrected. Normalize the clips to one rate before splicing, or convert the odd one out.
音频拼接失败,请检查音频通道数和形状是否一致. One input is mono and another is stereo, or shapes otherwise disagree. Convert the odd clip to match. This is a shape error, not a sample-rate error, so don't go hunting for resample settings.
Order came out reversed. You left 方向 on 之前, or you wired ports out of order and expected sorting. The node uses port number, not connection order, and never sorts for you.
One-second of silence appeared at the front. Something upstream emitted a silent placeholder because it had no result. This node can't tell silence from intent - filter it out with 筛选音频 before splicing, or fix the upstream branch. The batch node in this pack has a 跳过静音占位 toggle for exactly this reason; concat has no such switch.
If you're new to how audio even arrives in ComfyUI - it wasn't designed in, it was retrofitted - docs/knowledge/audio-generation.md is the honest map.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| 方向 | COMBO | 之后 | 2 options: 之后, 之前 |
| 音频1opt | AUDIO | — | |
| 音频2opt | AUDIO | — | |
| 音频3opt | AUDIO | — | |
| 音频4opt | AUDIO | — | |
| 音频5opt | AUDIO | — | |
| 音频6opt | AUDIO | — | |
| 音频7opt | AUDIO | — | |
| 音频8opt | AUDIO | — | |
| 音频9opt | AUDIO | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| 音频 | AUDIO | — |