List Index
List Index — pull one item out of a list by number
- list
- item
A list is only useful if you can get things back out of it. This node does exactly that: you feed it a LIST and an index, and it returns the single item at that position. It's the companion to the pack's Create List node - Create List bundles up to eight items into a list, List Index unwraps one of them by number. Together they're a poor man's "select a value" mechanism: build a list of seeds, strengths, or prompt variants, then dial through them with an index.
Two required inputs: list (a LIST) and index (an INT from 0 to 999, default 0). One output, item, typed as wildcard (*) since the list can contain anything.
The mechanism, and the one thing to memorize
Indexing is zero-based, which is the detail that trips everyone up once. index = 0 gives you the first item, not an empty result. A three-item list created with Create List holds items at positions 0, 1, and 2 - the last item is index = 2, never index = 3. If you're dialing through a list expecting it to start at 1, you'll skip the first item every time and wonder where it went.
The code does a bounds check before indexing: if the index is less than the length of the list, it returns the item; otherwise it returns None. So an out-of-range index doesn't crash your workflow - it silently hands you None, which then flows downstream and can produce confusing errors later ("expected a number, got nothing"). If your list is shorter than the index you're using, you'll get no warning. That's the main thing to watch: keep your index within 0 to len(list) - 1.
How you'll use it
The classic pattern is a seed or parameter selector. Create List with a handful of seeds, feed its output here, and drive index with a Constant Int or Counter - step the index and you step through the values. It's also useful for picking a single element out of any list some other node handed you, when you only want one entry. Because the output is wildcard, whatever type the item is flows through as-is, so you can pull a string, an int, or even a tensor out of a list without extra conversion.
Gotchas
Same wildcard caveat as Create List: nothing validates the item's type until a downstream node runs. And remember the pack's Create List skips unconnected slots - so if you built a list expecting 8 items but only wired 3, the list has 3 items, and index 4 will return None, not an empty slot. Read the length from the list itself, not from the number of slots you intended to fill.
Installing it
Standard Utilitools install:
cd ComfyUI/custom_nodes
git clone https://github.com/aesethtics/ComfyUI-Utilitools
or search "Utilitools" in ComfyUI Manager and restart ComfyUI. It's under Utilitools → Data. No dependencies, no model files, no requirements.txt - pure Python. It's a small pack with no community buzz to speak of, but for "give me item number N from this list," it's exactly one box.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| list | LIST | — | |
| index | INT | 00–999 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| item | * | — |