Index List From String
The adapter this whole pack exists for
- index_list
Index List From String is the reason Kesin11's ComfyUI-list-filter pack exists at all. The story, straight from the README: ComfyUI-Image-Selector is the node people use to pick frames out of a batch, and it hands you your selection as selected_indexes - a string like "0,2,5". Then nothing in your graph will accept that where it wants an index list. This node is the adapter that turns that string into a real INT list you can wire anywhere.
It's embarrassingly simple, and that's the point. Give it a string and a delimiter, get a list of integers back.
How it works
The whole node is a one-line list comprehension: [int(i) for i in string.split(delimiter)]. Split the input on the delimiter, convert each chunk to an integer, done. Python's int() is forgiving about stray whitespace, so "0, 2, 5" parses fine even though the README's examples stick to "0,2,5".
What it is not forgiving about is empty tokens. Feed it "0,,5" and int("") raises a ValueError - the node errors out mid-graph. Keep the string clean and the delimiter consistent, and you'll never see it.
The inputs that matter
string- the text to split (default""). This is usuallyselected_indexesfrom Image Selector, or whatever you typed into a pysssss ShowText node.delimiter- what to split on (default","). Change it to;or a space if your source uses something else.
The one output, index_list, is an INT list. It plugs straight into the index_list input of Filter Image List or Filter String List from this same pack. That's the canonical pipeline: Image Selector → Index List From String → Filter Image List → reroute the picked images to whatever node needs them.
One habit worth building early: indices here are zero-based, because that's what ComfyUI's list nodes expect. "0,2,5" means first, third, and sixth items. If you're coming from a tool that counts from 1, that off-by-one will bite you once and you'll never forget it.
Installing it
Like every node in this pack, there's nothing to it:
- ComfyUI Manager - search for
ComfyUI-list-filterand hit install, then restart. - Manual -
cd ComfyUI/custom_nodes && git clone https://github.com/Kesin11/ComfyUI-list-filter, then restart ComfyUI.
There's no requirements.txt, no Python dependencies beyond the standard library, and no model files. The entire pack is a handful of list comprehensions. That's a genuine relief in a world where most custom nodes drag in a dependency tree - this one can't conflict with anything in your environment because it imports nothing but random.
Gotchas worth knowing
- Empty tokens crash the node. Clean up your source string first.
- The delimiter is a plain string match, so pick one that doesn't appear inside your numbers.
- If you feed this node anything that isn't a plain integer,
int()will throw. Paste errors like"0, 2, 5,"(trailing comma) produce an empty token and the same crash.
For a node this small, the value is in what it unlocks: suddenly the string output of Image Selector becomes a first-class citizen in your graph. That one adapter makes the whole batch-picking workflow possible.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| string | STRING | The string to be split into indices. | |
| delimiter | STRING | , | The delimiter used to split the string. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| index_list | INT | — |