文本到列表🐠meeeyo.com
Turn a multiline box into a real STRING list — clean and empty-line-free
- STRING
ComfyUI's sampler and batch nodes love lists, but your hands type in a text box. TextToList is the bridge: take a multiline string, split it into lines, strip the whitespace, drop the empty ones, and output a genuine list of STRING - the kind that fans out into per-item processing. It's the one node in this pack whose output is explicitly OUTPUT_IS_LIST = True, so it feeds list-consuming nodes directly.
The Chinese display name is 文本到列表 ("text to list"). It's part of ComfyUI_StringOps, and it's the cleanest "one box to many items" node the pack offers - the one you'll reach for when you want a batch of prompts rather than one glued-together blob.
How it works
Two inputs:
- text - the multiline source. One item per line, typically.
- delimiter - if empty (the default), it splits on newlines. Set it to
,or|and it splits on that instead.
Then it strips each piece and filters out empties - so trailing commas, blank lines, and stray whitespace silently vanish. Output is a STRING list: ["prompt a", "prompt b", "prompt c"], which you can wire into anything that consumes a list, or into a loop/batch node to process each item.
Where you'd use it
Batch prompt generation is the headline use: keep 20 prompts in a multiline box, split to a list, feed a list-aware sampler or iteration node, and get 20 images without touching anything. It also pairs with the pack's own nodes - ReadExcelData produces newline-separated rows, which TextToList can split into a real list. And when your "list" is comma-separated, set the delimiter instead of pre-splitting.
The traps
Two things to keep in mind. First, empty items are removed, not preserved - if your list intentionally has blank entries (e.g. you're indexing positions), this node will shift everything. Second, it strips each item, so " foo " becomes "foo" - usually what you want, but it's a silent transform. And since it splits on exactly one delimiter, multi-level structures need multiple nodes.
Installing it
Pack standard: ComfyUI Manager → ComfyUI_StringOps, or
cd ComfyUI/custom_nodes
git clone https://github.com/MeeeyoAI/ComfyUI_StringOps.git
Restart. Pure Python - no extra dependencies.
The honest take
This is a top-three node in the pack for practical value: "typed list → real list" is one of those boring bridges you end up using constantly once you know it exists. If the pack's TextConcatenation is the flashy formatter, TextToList is the reliable delivery mechanism behind it. Just remember it cleans your data as it converts - empties and whitespace don't survive, which is a feature until it isn't.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | — | |
| delimiter | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |