String Toggle (Multiline)
Switch between long-form prompt blocks with checkboxes
- STRING
String Toggle (Multiline) is the same node as String Toggle under a second name, with one difference that only shows up in the frontend: the text slots are big multiline textareas instead of single-line boxes. Same Python class, same separator, same Add/Remove buttons, same per-unit on/off toggles, same STRING output - but built for prompts that are paragraphs, not tag lists.
Why you'd reach for it
That turns out to be exactly the niche it wants. Modern LLM-encoded checkpoints (Flux 2, Anima, the Z-Image line) read prompts as sentences and instructions, and the community's strongest prompting advice for them is block-structured prose: a settings block, a scene-description block, a style block, separated by blank lines. Multiline Toggle is the natural fit for that workflow - each textarea holds one block of prose, each checkbox turns that block on or off, and you compare whole prompt architectures by toggling instead of by editing and re-pasting. Need to test "keep the description, drop the lighting paragraph"? One click.
How it works
Mechanically nothing changes from its single-line sibling: click Add to get a new unit (divider + toggle + textarea), type a block, and the Python join collects every unit whose toggle is enabled, prepends the previous wire-in input if it's filled, and joins it all with the separator field (default ", " - though for prose you might set it to a space or leave a newline in your blocks). The result is one STRING you feed straight into CLIPTextEncode. Units and their enabled states are saved into the workflow, so your A/B setups survive reload.
Gotchas
The same gotchas apply, with one extra wrinkle. Enabled-but-empty units still get joined, so an on-but-blank textarea injects a stray separator into your prompt - switch it off. And the separator is a literal string with no escape processing: typing \n gives you backslash-n, not a line break, so if you want blank-line separation between blocks, put the newlines inside your multiline blocks rather than trying to fake them in the separator field. The bigger structural caveat: like String Toggle, this node redefines the server node from frontend JavaScript via the beforeRegisterNodeDef override (rgthree's pattern), which is the exact thing that broke under ComfyUI's Nodes 2.0 frontend rewrite. If the textareas or toggles don't render on Nodes 2.0, that's why - the standing fix is to leave Nodes 2.0 off.
Install
Install is the whole pack in one command, via ComfyUI Manager (search ComfyUI-String-Chain) or:
cd ComfyUI/custom_nodes
git clone https://github.com/uihp/ComfyUI-String-Chain
Restart and both toggle nodes appear - they share the same class, so one install covers them. No requirements.txt, no models, no GPU work. It's a young, quiet pack with no community footprint yet, but the code is short and self-contained. If you're doing long-prompt work on a sentence-reading checkpoint and you've been hand-editing a wall of prose between generations, this is the box of checkboxes you've been missing.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| separator | STRING | , | — |
| previousopt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |