π CR Text Input Switch
Flip between two text sources with one number
- STRING
- show_help
Same idea as Comfyroll's other input switches - MODEL, VAE, latent, conditioning - applied to plain text. Wire in two strings, flip a number between 1 and 2, and whichever one you picked gets forwarded. It's the node for A/B'ing two prompt variants, two style strings, or two captions without rewiring anything every time you want to compare.
How it works
text1 and text2 are both optional - leave whichever branch you're not using disconnected. Input, an integer restricted to 1 or 2, decides which one gets passed through as the output. It's a pure passthrough: nothing about either string is modified, and the one you didn't select simply isn't used for that run.
Comfyroll ships this same 1-or-2 switch pattern for nearly every socket type in ComfyUI - model, latent, conditioning, CLIP, VAE, image, ControlNet, and text. Once you've used one, you already know how the rest behave: same Input convention, same optional-inputs-but-selected-one-must-be-connected rule.
Why a switch instead of just editing the text
The alternative to this node is obvious: just edit the text box you're using directly, run, edit it back if you want to compare. That works fine for a one-off check, but it falls apart the moment you want to keep both versions around - a "before" and an "after," a shorter and a longer variant of the same prompt - and flip between them repeatedly while judging results side by side, or while an automated sweep needs to alternate between them across runs. Wiring both into a switch means neither version is ever destroyed by editing over it, and flipping Input is a one-field change instead of a copy-paste-and-hope.
It's also the node you'd reach for if Input is being driven programmatically rather than clicked by hand - from a loop counter, or from something like Comfyroll's own index nodes - to alternate between two fixed text variants automatically across a batch rather than one variant staying fixed the whole run.
Inputs and outputs that matter
Input- integer, 1 or 2. The switch itself.text1,text2- the two optional text sources.
Output: STRING (whichever was selected) plus the standard show_help link.
How to install it
ComfyUI Manager - search "Comfyroll Studio", install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes.git
then restart. No models - this routes text you've already produced elsewhere.
Common issues
The classic trap: leave Input on 1, edit text2, and wonder why nothing downstream changed. Check the switch value first before assuming something's broken further down the graph - this is the single most common way people waste time on this node.
Both text inputs being optional at the node level doesn't mean the one you've actually selected can be empty - if Input is set to 2 and text2 isn't wired to anything, you'll get an empty (or missing) output, not a fallback to text1.
If it's missing from your search entirely, that's the pack-wide failure: Comfyroll registers its whole node set from one file, so a single broken import takes every CR node down. Check your ComfyUI console for Comfyroll Studio: Failed to load ... nodes, usually a Pillow version conflict from another custom node, and reinstall Pillow or update the pack through Manager to fix it.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| Input | INT | 11β2 | β |
| text1opt | STRING | β | |
| text2opt | STRING | β |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | β |
| show_help | STRING | β |