Nodes/Audio Batch/Batch Audios
ComfyUI Node

Batch Audios

Batch Audios — the node that makes one noodle carry many sounds

By set-soft·Created about a year ago·Updated about a year ago· 8
Batch Audios
  • audio1
  • audio2
  • audio_batch

ComfyUI's image side leans on batches constantly - a (B, C, H, W) tensor where B is how many images you're shuffling around at once. Audio is the same under the hood, but there was almost nothing to build batches until this pack showed up. Batch Audios (SET_AudioBatch) is the namesake node for a reason: it's the tool that lets you jam multiple audio clips onto a single AUDIO wire and treat them as one unit.

That's not a niche trick. Batch anything and the workflow scales: generate one clip per prompt, batch them up, feed the whole stack into a video or a sampler that consumes AUDIO, or process ten clips through one channel-conversion node instead of ten copies of it.

How it works

The mechanism is simple but opinionated, and you need to know the opinion before you use it. ComfyUI's AUDIO type is a dict holding a waveform tensor of shape (batch, channels, samples) plus a sample_rate. Audio Batch's whole job is making two such tensors safe to stack, and that means aligning them. The node takes audio1 and audio2 (each can already be a batch) and produces audio_batch with B1 + B2 items. To get there it:

  • Resamples everything to audio1's sample rate. Your first input is the reference; the second gets pulled up or down to match.
  • Standardizes channels. Mono + mono stays mono. Any mono + stereo combo becomes "fake stereo" by duplicating the mono channel. Both stereo stays stereo. Anything more exotic (5.1, say) defaults to the max channel count with a warning - no fancy downmixing, which the README is upfront about being on the TODO list.
  • Pads shorter clips with silence to the length of the longest, so every item in the batch has the same sample count.

If your two inputs are already the same rate and channel count, it's a straight cat() along the batch axis - instant. The alignment logic is exactly why this is the pack's workhorse, because the same aligner is reused by Audio Concatenate and Audio Join 2 Channels.

The flip side: Select Audio from Batch

Batches are great until you need one clip back. The companion node Select Audio from Batch (SET_SelectAudioFromBatch) pulls a single item out by index, with sensible out-of-range handling. Together they're the audio equivalent of batching latents: Batch Audios to go wide, Select to come back to one. The pack's example workflow audio_batch_select_example.json shows exactly this loop, and the _extra variant adds the Audio Download and Load node so you can run it without hunting for audio files.

Install

From ComfyUI Manager, search "Audio Batch", or manually:

cd ComfyUI/custom_nodes/
git clone https://github.com/set-soft/ComfyUI-AudioBatch
pip install seconohe

Restart ComfyUI. Zero model downloads; the only runtime deps beyond what ComfyUI ships are torch, torchaudio, numpy and the small seconohe helper.

Gotchas

The gotcha that bites everyone eventually: the output batch's sample rate is always audio1's. If you pass a 44.1 kHz clip as audio1 and a 48 kHz one as audio2, your whole batch silently becomes 44.1 kHz - the second clip got resampled without telling you. That's usually what you want for consistency, but if you care which rate wins, put the important one in audio1. And remember the output is one tensor of padded clips: every clip is as long as the longest. If that padding surprises you downstream (say, a 30-second gap appears in a video sync), that's the silence padding doing its job - the README lists choosing a padding value as a future feature.

Categoryaudio/batch

Inputs (2)

NameTypeDefaultDescription
audio1AUDIOThe first audio input. Can be a single audio item or a batch
audio2AUDIOThe second audio input. Can be a single audio item or a batch

Outputs (1)

NameTypeDescription
audio_batchAUDIO