Nodes/ComfyUI-AudioSuiteAdvanced/Index Select From List (ASA)
ComfyUI Node

Index Select From List (ASA)

Grab the Nth Item Off Any List — and Remember It's 0-Based

By whmc76·Created about a year ago·Updated 15 days ago· 29
Index Select From List (ASA)
  • input_list
  • selected_item
index0

Index Select From List (ASA) is plumbing, plain and simple: you feed it a LIST, tell it which position you want, and it hands you that one element as a string. That's the entire job. In the graph it plays the role of the list[i] line you'd write in Python - it's how you pick a single item out of a collection and push it down a normal, non-list wire.

Where it earns its keep in this pack: Long Text Splitter gives you a list of text chunks, and you want to feed one chunk into a TTS node per iteration inside a loop. Or you have a list of audio file paths and you want to process just the third one. The pack's own example workflow uses exactly this - LongTextSplitter's list goes in, a per-chunk TTS call comes out the other side.

How it works

input_list is any LIST; index is an integer, default 0. The node clamps the index into range, pulls the element, and casts it to a string. That last part is worth internalizing: the output is always a STRING, even if the list held numbers or something more exotic.

The two inputs you actually set

  • input_list - any list. Text chunks, audio paths, whatever.
  • index - which element to grab, starting at 0. Default 0 (the first item).

Output: selected_item as a STRING.

Installing it

It ships in whmc76/ComfyUI-AudioSuiteAdvanced (display "AudioSuiteAdvanced"). ComfyUI Manager → search "AudioSuiteAdvanced", or:

cd ComfyUI/custom_nodes
git clone https://github.com/whmc76/ComfyUI-AudioSuiteAdvanced
cd ComfyUI-AudioSuiteAdvanced
pip install -r requirements.txt

Restart ComfyUI afterward. No model files, no extra weights - this node has zero heavy dependencies of its own.

The two gotchas

First, the index is 0-based. Index 0 is the first element, index 1 the second. It's the default that gets people every time - they set it to 1 expecting the first item and silently get the second.

Second, out-of-range is clamped, not an error. Ask for index 99 on a 3-item list and you'll get the last element back. That's forgiving in a loop but it can hide bugs - a loop that runs one iteration too long will quietly re-emit the tail item instead of failing loudly. If you're looping over a list, pair this with List Length to bound your loop so you never actually need the clamping.

One more honest note: this is a list-indexer from an audio pack, but lists are lists. If you want something with more polish for general-purpose list wrangling, the big utility suites (rgthree, Impact, the various "node plumbing" packs covered in the ComfyUI node-plumbing docs) have richer equivalents. This one is fine, free, and already in your graph if you installed the pack - use it, don't fight it.

CategoryAudioSuiteAdvanced

Inputs (2)

NameTypeDefaultDescription
input_listLIST
indexINT00–999999

Outputs (1)

NameTypeDescription
selected_itemSTRING