Text Split (by separator)
One prompt, eight outputs, and a remainder you don't lose
- text_1
- text_2
- text_3
- text_4
- text_5
- text_6
- text_7
- text_8
- remainder
Text Split takes one multiline string and splits it into up to eight separate outputs plus a remainder socket, so nothing you feed it ever gets thrown away. It's the node someone points you to when you ask r/comfyui "how do I split text into different prompts?" - and yes, this is the exact pack that answer links.
Why would you need that? The classic case is a single long prompt that has to drive several things at once - a multi-scene render where each scene's text goes to its own CLIP encoder, or a schedule where different chunks feed different samplers. Instead of copying the prompt into four separate text nodes and praying you keep them in sync, you split once and wire the outputs.
How it works
Feed text in (multiline, so wire a selector, Lazy Prompt Saver, or LazyPrompt output here), then pick how to split:
separator- a literal string (default|), or a regex wrapped in slashes like/\\|/for fancier delimiters.num_splits- how many primary outputs (text_1…text_n) to fill before the remainder. Range 1–8.trim_whitespaceandremove_empty- tidy up chunks so indices stay meaningful.tagged_format- the pack-specific mode. When ON, it splits at[Tag]lines instead of a separator, fillingtext_1,text_2, … with each section's body. This is what makes it work with the pack's subject/scenario files: auto-detected when the first line is[LoraHighA](the v2 file format), so those files split correctly without you doing anything.
The node always shows all nine outputs - text_1 through text_8, then remainder. Only the first num_splits plus remainder are meaningful; the rest are empty strings, so wiring them all is harmless. remainder is the "everything after the Nth split" bucket, which is the feature that separates this from a naive split: you can split off the first two chunks for dedicated encoders and still have the rest of the prompt intact downstream.
Where it fits
Two patterns from the pack's own docs are worth stealing:
- Selector → Text Split. Subject/scenario files (v2 format) split automatically - each
[Tag]section becomes an output. Legacy#-separated files work withseparatorset to#when auto-detect doesn't apply. Forcetagged_formatON for other[Tag]layouts that don't start with[LoraHighA]. - Parallel encoders. Wire
text_1,text_2, … into separate CLIP Text Encode nodes for multi-part conditioning.
It's also the natural consumer of LazyPrompt's PROMPT output if you want to drive several branches from one expanded prompt.
Install
Standard pack install: ComfyUI Manager → search vsaan212/Vsaan212-workflow-utilities, or clone into custom_nodes and restart. Menu: vsaan212/utilities. Genuinely zero dependencies - the code is pure Python standard library (its own requirements.txt says so), so there's nothing to break and no model downloads. That's the reason it gets recommended in help threads: it just works.
One small note: the separator you set is also what rejoins the remainder chunks, so if you split on |, the remainder comes back as |-joined text. Plan your delimiter accordingly and keep trim_whitespace on.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | — | |
| separator | STRING | | | — |
| num_splits | INT | 21–8 | — |
| trim_whitespace | BOOLEAN | true | — |
| remove_empty | BOOLEAN | true | — |
| tagged_format | BOOLEAN | false | Split at [Tag] lines. Auto-enabled when the first non-empty line is [LoraHighA] (v2 subject/scenario files). Otherwise this toggle applies. |
Outputs (9)
| Name | Type | Description |
|---|---|---|
| text_1 | STRING | — |
| text_2 | STRING | — |
| text_3 | STRING | — |
| text_4 | STRING | — |
| text_5 | STRING | — |
| text_6 | STRING | — |
| text_7 | STRING | — |
| text_8 | STRING | — |
| remainder | STRING | — |