Teeth Text Split By Delimiter
Split Text Into a List by Any Delimiter (Newlines Included)
- list
Text in ComfyUI arrives as one big blob, and half the time you need it broken into pieces. A comma-separated tag list you want to index, a file of one-prompt-per-line you want to iterate, a Gemini reply you want to split into bullets. Teeth Text Split By Delimiter is the small node that does the obvious thing: give it text and a delimiter, get a LIST back.
It's one of the plainest members of the ComfyUI-Teeth pack - a thin wrapper around Python's str.split() with a couple of thoughtful touches. No models, no config, no setup.
How it works
The core is exactly what you'd hope: split the text on delimiter, keep the pieces, drop the empty strings, return them as a list output. Two details make it friendlier than raw Python:
Delimiter accepts escape sequences. The delimiter field is unicode-escape decoded before splitting, so you can actually type \n into the field to split on newlines - the classic "one prompt per line" case:
text: "cat\ndog\nbird"
delimiter: "\n"
list: ["cat", "dog", "bird"]
That's the trick most people miss, because the field looks like a plain text box and \n as two characters won't match a real newline without this step.
Empty lines are stripped. Blank chunks between separators get dropped, so "a,,b," with a comma delimiter gives ["a", "b"] rather than a list full of holes. That's usually what you want, but it means you can't preserve intentional empty fields - if you're parsing CSV-ish data and the empties matter, this node will quietly eat them.
Inputs and outputs that matter
- text (multiline, required) - the string to split.
- delimiter (default
,) - the split marker. Use\nfor newlines. - list (output) - the pieces as a LIST.
From here it feeds the same destinations as any list: Teeth Get Value By Index From List to pull one item, a text-list iterator, or a display node to eyeball the split.
Where people get burned
Empty delimiter doesn't mean "split everywhere." With a blank delimiter the node gives up splitting and returns [text.strip()] - the whole text as a single-element list. If you were hoping for a character-by-character split, that's not this node. It's also the one edge case where it won't match Python's str.split() behavior, so it's worth knowing on purpose rather than discovering.
The escape handling is on by default. Because delimiters go through unicode-escape decoding, a literal backslash in your delimiter can behave unexpectedly - if you're splitting on something containing a backslash, you may need to escape it. Edge case, but it exists.
Whitespace-only pieces vanish. Combined with the empty-line stripping, trailing or leading delimiters in your text simply disappear from the output. If your piece count comes up short of your expectation, look at the raw text's stray separators first.
Install
ComfyUI Manager: search ComfyUI-Teeth. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/steelan9199/ComfyUI-Teeth
Restart ComfyUI. Pure standard library - no dependencies to satisfy, nothing to download. It's the kind of node you'll forget exists until you hit the exact "I just need this text in pieces" moment, and then you'll be glad it's there.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | — | |
| delimiter | STRING | , | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| list | LIST | — |