String List to Combo
Split a delimited string and pick an item
- *
Take one string with several values packed into it, split it on a separator, and pull out a single item by index. That's the node. It turns something like cat$dog$bird into a list and hands you one entry - dog if you ask for index 1 - as a generic value you can wire anywhere.
Why bother? Because it lets you keep a list of options in one text field and select from it by number, instead of building a fan of nodes or hardcoding choices. Pair the index with a seed or a counter and you can step through a set of prompts, styles, or filenames across a batch, one per run, all driven from a single string you edit in one place.
How it works
You give it the packed string and tell it what character separates the items. It splits on that separator into a list, then returns the element at your index. The output type is the wildcard *, meaning ComfyUI treats it as a generic value that can connect to many input types - the "combo" in the name is that flexible, any-type output.
The inputs that matter
- string - your packed values, joined by the separator.
- separator (default
$) - the character to split on. The default is$rather than a comma, which is deliberate: commas show up constantly inside prompts and tags, so$avoids splitting your text in places you didn't mean. Use whatever won't collide with your content. - index (optional, default 0) - which item to return, counting from 0. Index 0 is the first element.
Output is a single value on the wildcard * slot.
The gotcha
Watch your index bounds. If you ask for index 5 but your string only splits into three items, you're off the end of the list and the node will error rather than silently return something. When you're driving index from a counter or a seed-modulo, make sure the number wraps within the count of items you actually have. Also mind stray separators - a trailing $ creates an empty final element that shifts nothing but can surprise you when counting.
Installing ComfyUI-LogicUtils
ComfyUI Manager: Install Custom Nodes → search "ComfyUI-LogicUtils" → install → restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/aria1th/ComfyUI-LogicUtils
Restart ComfyUI. No dependencies.
Worth knowing
This is the inverse of ConvertComboToString in the same pack, which joins a list back into a delimited string with the same $ default - so the two round-trip cleanly if you keep the separator consistent. The pack is aria1th's (AngelBottomless) undocumented toolkit, but this node is self-explanatory once you internalize the two rules: pick a separator that isn't in your data, and keep your index inside the list.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| string | STRING | — | |
| separator | STRING | $ | — |
| indexopt | INT | 0 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| * | * | — |