Nodes/ComfyUI Audio Segment Plugin/Select AudioClip From List
ComfyUI Node

Select AudioClip From List

Grab One Paragraph's Clip — Audio and Its Transcript Together

By ahkimkoo·Created 12 months ago·Updated 12 months ago· 5
Select AudioClip From List
  • audio_clip_list
  • audio
  • text
index0

This is the companion node to Audio Segment By Paragraph, and it exists to solve a specific annoyance: that node hands you a list of aligned clips, but ComfyUI can't just "loop over a list" by default. So when you want one paragraph's clip - say, clip #3 - you need a node that reaches in and pulls it out by index. This is that node, and it's thoughtful enough to hand you the clip's text alongside its audio, which turns out to be exactly what you need for a lot of downstream work.

What it does

You give it the AudioClip list from the paragraph node plus an index (0-based), and it returns two things:

  • audio - the AUDIO object for that clip, ready to wire into anything that takes audio.
  • text - the transcript string for that clip, from the paragraph it was aligned to.

Having the text ride along is the whole point. If you're building a TTS or lip-sync pipeline, you almost always want the audio and its transcript together, so you can re-synthesize or condition on the same words. Grabbing both from one node saves you from re-deriving the text with a separate ASR step.

Inputs

Only two, and they're both straightforward:

  • audio_clip_list - the list output of Audio Segment By Paragraph. It's typed *, so wrong wiring won't error loudly at the canvas level.
  • index - which clip, starting at 0 (default 0, min 0).

The behavior when the list is empty or the index is out of range is worth knowing: it doesn't crash, it returns a silent one-sample audio and an empty string. That's actually convenient for lazy graphs that run before the splitter has produced anything - but it also means an out-of-range index fails silently. If you're getting blank output, check your index against the size output of the paragraph node first.

Installing the pack

ComfyUI Manager: search "Audio Segment" (pack title ComfyUI Audio Segment Plugin). Manual:

cd path/to/ComfyUI/custom_nodes/
git clone https://github.com/ahkimkoo/Comfyui-AudioSegment
cd Comfyui-AudioSegment
pip install -r requirements.txt

Restart ComfyUI and the nodes live under Audio/Segmentation. The install is shared with the whole pack, so you're pulling the heavy dependencies (torch, openai-whisper, transformers, accelerate, pydub, opencc-python-reimplemented) even though this tiny selector needs none of them. That's the tradeoff of five nodes, one install: you pay for the paragraph splitter's needs whether you use it or not.

Picking the right selector

Don't confuse this with the pack's other, nearly-twin node Select Audio From List. That one works on the plain audio_list from the silence-based Audio Segmenter and returns audio only. This one works on the AudioClip list from the paragraph node and returns audio plus text. Same idea, different half of the pack, and the input types won't visibly stop you from crossing the wires - remember, both lists are typed *. If you're after per-paragraph audio with its transcript, this is the one. If you just want to index a plain split, use the other.

CategoryAudio/Segmentation

Inputs (2)

NameTypeDefaultDescription
audio_clip_list*
indexINT0

Outputs (2)

NameTypeDescription
audioAUDIO
textSTRING