Nodes/yanhuo-easy-use/音频批次合并
ComfyUI Node

音频批次合并

Put fifty audio clips on one wire — and don't glue them together

By yanhuoxunxianren·Created 27 days ago·Updated 21 days ago· 2
音频批次合并
  • audio_1
  • audio_2
  • audio_3
  • audio_4
  • audio_5
  • audio_6
  • audio_7
  • audio_8
  • audio_9
  • audio_10
  • audio_11
  • audio_12
  • audio_13
  • audio_14
  • audio_15
  • audio_16
  • audio_17
  • audio_18
  • audio_19
  • audio_20
  • audio_21
  • audio_22
  • audio_23
  • audio_24
  • audio_25
  • audio_26
  • audio_27
  • audio_28
  • audio_29
  • audio_30
  • audio_31
  • audio_32
  • audio_33
  • audio_34
  • audio_35
  • audio_36
  • audio_37
  • audio_38
  • audio_39
  • audio_40
  • audio_41
  • audio_42
  • audio_43
  • audio_44
  • audio_45
  • audio_46
  • audio_47
  • audio_48
  • audio_49
  • audio_50
  • audios
◄输入数量3►
◄跳过静音占位true►

Audio in ComfyUI is a bolted-on layer: the models are good, but the piping around them is whatever a node pack author happened to need. One of the things nobody bothered to build for a long time is the boring half - getting many audio files into a graph without a fan of loaders and savers. This node is that boring half. It takes up to fifty audio inputs and packs them into a single audio batch, which is ComfyUI's way of saying "a list of separate clips travelling down one wire."

Batch is not concat, and the difference matters

If you want one long file, you want 音频拼接 (YanhuoAudioConcat). This node does the opposite: every clip stays its own clip, with its own sample rate and channel count. Nothing gets resampled, nothing gets trimmed to match, nothing gets glued. It is the audio equivalent of stacking images into one IMAGE batch.

That distinction is the whole reason it exists. Say you generated eight TTS takes and want to audition them, or you're assembling a scene where each line of dialogue has to keep its own timing. Concatenating destroys that - you get one waveform and you have to slice it back apart. A batch keeps the segments addressable, so 筛选音频 can pull out take 5 and 音频批次预览/保存 can play each one in its own row.

How it actually works

The 输入数量 widget (2–50) controls how many audio_1…audio_50 ports exist on the node. Change the number, then click the 更新输入 button on the node body - the ports do not appear until you do, and that trips up basically everyone the first time.

Once you queue, the node walks your connected ports in numeric order and, for each one, filters hard:

  • Unconnected ports are skipped (an unconnected optional input simply arrives as nothing).
  • Empty waveforms and zero-sample clips are skipped.
  • Each clip is normalized into a one-item batch of shape [1, C, T], so an upstream node that already emitted a batch gets split back into individual clips in batch order.
  • With 跳过静音占位 on (the default, and you should leave it on), pure-silence audio is dropped too.

That last one is the quietly clever bit. Loading nodes in this ecosystem love to emit a one-second silent placeholder when they have no result, so an empty input never breaks the chain. Here that convention is read as "this branch produced nothing" and the silent stub is discarded rather than padding your batch with dead air. If you genuinely want silence in the batch - a beat of pause between lines, say - turn the toggle off and it stays.

Sample rate and channel mismatches only print a line to the console. Nothing is resampled, which is correct for a batch (the segments are independent), but it does mean the batch itself is not a uniform thing. If everything is empty, you get one second of silence rather than an exception, so a graph that looks like it ran is not proof that anything loaded.

Wiring it up

The single output is audios, typed AUDIO and flagged as a list. It feeds:

  • 音频批次预览/保存 - the natural endpoint: per-clip players, and flac/mp3/opus saving when you're happy.
  • 筛选音频 - reorder or cherry-pick segments by index.
  • Anything downstream that declares INPUT_IS_LIST on its AUDIO socket.

Do not feed an audio batch into a node with a plain AUDIO input and expect it to consume the list; most nodes that take AUDIO want one clip. Split it first.

Install

It's part of the 16-node yanhuo-easy-use pack (category yanhuo, Chinese UI labels, MIT). Either search the pack title in ComfyUI Manager, or:

cd ComfyUI/custom_nodes
git clone https://github.com/yanhuoxunxianren/yanhuo-easy-use
# restart ComfyUI

No pip install step: the pack's pyproject.toml declares no dependencies, and the modules it imports - numpy, torch, Pillow, av (PyAV) - are all in ComfyUI's own environment. av is imported defensively, so if your install somehow lacks it, audio loading and saving raise a clear error instead of breaking the whole pack.

Common issues

"My ports won't show up." You changed 输入数量 but didn't click 更新输入. The widget and the sockets are separate; the button commits the change.

"A clip went missing from the batch." Check the console. Either it loaded as pure silence (skipped by 跳过静音占位), or it arrived as an empty/zero-sample waveform. Both cases print a line naming the port number.

"Downstream is complaining about the sample rate." The batch mixes whatever rates your clips had. Canonicalize upstream if a consumer needs one rate, or save the segments individually and normalize afterwards.

Cache weirdness. Like many loader-ish nodes, this one is not the thing to blame first - but if a run appears not to re-read a file you swapped on disk, note the pack's loading nodes re-read on every execution, so a stale result usually means the graph never re-queued that branch.

For the wider picture of what audio tooling exists on this side of the ecosystem and how thin the layer is, see docs/knowledge/audio-generation.md.

Categoryyanhuo

Inputs (52)

NameTypeDefaultDescription
输入数量INT32–50—
跳过静音占位BOOLEANtrue上游节点无结果时常输出纯静音占位音频,开启时视为空输入跳过,不参与打包。
audio_1optAUDIO—
audio_2optAUDIO—
audio_3optAUDIO—
audio_4optAUDIO—
audio_5optAUDIO—
audio_6optAUDIO—
audio_7optAUDIO—
audio_8optAUDIO—
audio_9optAUDIO—
audio_10optAUDIO—
audio_11optAUDIO—
audio_12optAUDIO—
audio_13optAUDIO—
audio_14optAUDIO—
audio_15optAUDIO—
audio_16optAUDIO—
audio_17optAUDIO—
audio_18optAUDIO—
audio_19optAUDIO—
audio_20optAUDIO—
audio_21optAUDIO—
audio_22optAUDIO—
audio_23optAUDIO—
audio_24optAUDIO—
audio_25optAUDIO—
audio_26optAUDIO—
audio_27optAUDIO—
audio_28optAUDIO—
audio_29optAUDIO—
audio_30optAUDIO—
audio_31optAUDIO—
audio_32optAUDIO—
audio_33optAUDIO—
audio_34optAUDIO—
audio_35optAUDIO—
audio_36optAUDIO—
audio_37optAUDIO—
audio_38optAUDIO—
audio_39optAUDIO—
audio_40optAUDIO—
audio_41optAUDIO—
audio_42optAUDIO—
audio_43optAUDIO—
audio_44optAUDIO—
audio_45optAUDIO—
audio_46optAUDIO—
audio_47optAUDIO—
audio_48optAUDIO—
audio_49optAUDIO—
audio_50optAUDIO—

Outputs (1)

NameTypeDescription
audiosAUDIO—