Delimiter → Multiline Split
Turn a comma-separated string into a proper multiline list
- multiline
- count
Half the "prompt lists" you'll touch in ComfyUI come in as one ugly comma-separated blob - an LLM output, a CSV export, a tags string - and the nodes that want per-item access expect newline-separated lines. This node is the adapter: split on any delimiter you like, and out comes a multiline string plus the item count.
It's a small node with a small job, and it's exactly the kind of glue that keeps a workflow from needing a Python node or a manual reformat. If you've ever sat there turning "red, green, blue" into three lines by hand, this is the node that ends that.
What it needs
- text - the string to split.
- delimiter - what to split on. Default
,(comma). It's a plain string, so;or|or--all work - whatever your source uses. - strip_whitespace - trims spaces around items. Default true, so
"red, green, blue"becomesred/green/bluewithout stray leading spaces. Turn it off only if you genuinely care about the whitespace.
Two outputs:
- multiline - the items, one per line, ready to feed into a string-indexer or random-picker node.
- count - how many items came out. Feed this into a range or check to know your list length, or just to confirm the split did what you expected.
The pattern it enables
This is normally the first step of a "take a messy list, make it usable" chain: DelimiterSplit → StringListIndex/StringListRandom → prompt encoder. The count output closes the loop - indexers need to know when they're past the end, and random picks are nicer when you know how many candidates exist.
One honest note: it's a naive str.split(delimiter), not a CSV parser. If your data has quoted commas inside items ("New York, NY"), it'll split in the middle of them. For well-formed CSV with quoting, a proper CSV tool beats this; for the 95% case of simple delimited lists, it's perfect.
Install
Part of Vantage-Nodes:
cd ComfyUI/custom_nodes
git clone https://github.com/vantagewithai/Vantage-Nodes.git
pip install -r requirements.txt
or ComfyUI Manager → search "Vantage-Nodes" → Install → restart.
Common issues
- Items still have spaces - strip_whitespace got switched off, or the delimiter doesn't match your source (e.g. source uses
;). - Split in the middle of a quoted item - known limitation of plain string splitting; use a CSV-aware tool for quoted data.
- Trailing empty item - a trailing delimiter like
"a,b,"yields an empty last line. Trim the source or filter empties downstream.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | — | |
| delimiter | STRING | , | — |
| strip_whitespace | BOOLEAN | true | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| multiline | STRING | — |
| count | INT | — |