Nodes/Audio Batch/Select Audio from Batch
ComfyUI Node

Select Audio from Batch

Select Audio from Batch — pull one clip back out of the pile

By set-soft·Created about a year ago·Updated about a year ago· 8
Select Audio from Batch
  • audio_batch
  • selected_audio
index0
behavior_out_of_rangesilence_original_length
silence_duration_seconds1.0

Batching audio is only useful if you can get your hands back on a single clip. That's the entire job of Select Audio from Batch (SET_SelectAudioFromBatch), the other half of the pair that starts with Batch Audios. Build a batch, process it as a unit, then pluck out item number whatever and route it somewhere specific - like one clip in a batch feeding a video frame, or a single voice line going to a speaker.

The inputs that matter

  • audio_batch - the AUDIO value holding multiple clips (straight from Batch Audios or anything else that emits a multi-item batch).
  • index - zero-based position of the clip you want. 0 is the first, 1 the second, and so on. This is where beginners trip: it's not "1 = first clip," it's 0-based like everything else in ComfyUI.
  • behavior_out_of_range - what happens when your index doesn't exist. Three choices, and the defaults are worth understanding before you need them:
    • silence_original_length (default) - returns silent audio matching the batch's channel count and duration. Your workflow keeps running, but you get a hole where sound should be.
    • silence_fixed_length - same idea, but you pick the duration with silence_duration_seconds.
    • error - hard stops the workflow and shows the error in the ComfyUI UI. Best when a missing index means something is genuinely wrong and you want to know instantly, not discover a silent gap later.

Output

selected_audio comes out as a batch of exactly one - consistent with how every node in this pack treats the AUDIO type, so you can feed it straight back into anything that consumes audio. If the index was out of range and you picked a silence behavior, you get silence instead of a crash.

When you'd actually use it

The natural pattern is "process everything, branch one thing." Generate or load ten clips, normalize them together, then select clip 3 to do something bespoke - add gain, cut it, route it to a different output - while the rest of the batch flows on untouched. The pack's audio_batch_select_example.json workflow demonstrates exactly this: batch a few files, then pull individual ones out and play them.

If your index is driven by another node (an integer from a counter, a loop, a UI slider), this node becomes a neat little audio switcher - change the integer, and a different clip comes out the other side.

Install & gotchas

It ships with the Audio Batch pack - ComfyUI Manager search "Audio Batch", or:

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

Then restart. The main gotcha is the 0-based index, plus the silent default. If a workflow "runs fine" but you hear nothing, check whether you asked for index 5 in a 4-item batch and got silence_original_length back. Want it loud and obvious instead? Set behavior_out_of_range to error - that turns silent failures into immediate red text on screen.

Categoryaudio/batch

Inputs (4)

NameTypeDefaultDescription
audio_batchAUDIO
indexINT00–18446744073709550000
behavior_out_of_rangeCOMBOsilence_original_length3 options: silence_original_length, silence_fixed_length, error
silence_duration_secondsFLOAT1.00.01–3600

Outputs (1)

NameTypeDescription
selected_audioAUDIO