StringSwitchOpalSky
The prompt switcher born in a Reddit comment
- concatenated_string
This node has an origin story, and it's a good one. In October 2024 someone on r/comfyui asked for a node with a prompt switcher - the ability to toggle whole prompt snippets on and off, Power-Lora-Loader style. The author of this pack answered with "here is my attempt at this node. Feedback is welcome" and dropped a GitHub link. StringSwitchOpalSky is that attempt, shipped essentially unchanged since.
What you get is five string slots, each with its own on/off toggle. Put a phrase in string_1, flip switch_string_1 on, and it gets included in the output; flip the switch off and the phrase vanishes without you deleting anything. That's the whole core loop, and it's genuinely handy when you're A/B-testing lighting descriptions or toggling an artist tag between runs without rebuilding the prompt.
The inputs that actually matter:
use_custom_strings(default on) anduse_styles(default off) - the two master switches.string_1throughstring_5, each paired withswitch_string_1throughswitch_string_5.preset- Custom, Cinematic Noir, Fantasy Illustration, Retro Sci-Fi. A non-Custom preset overrides the style dropdowns with a hardcoded combo.- The five style dropdowns (
Lighting_and_Atmosphere,Artistic_Medium_and_Texture,Cultural_and_Genre_Influences,Composition_and_Style_Structure,Photography_and_Realism), which only do anything whenuse_stylesis on.
Enabled custom strings get concatenated first, then the selected style tags if use_styles is on, and everything joins with ", " into a single concatenated_string output. Wire that into a CLIPTextEncode positive input and you're done. Flip both master switches off and you get an empty string - a cheap way to mute the node entirely.
Installation is the same as its sibling: clone the pack into custom_nodes and restart, or find it in ComfyUI Manager.
cd ComfyUI/custom_nodes
git clone https://github.com/OpalSky-AI/OpalSky_Nodes
No dependencies, no model files, nothing to download.
The gotchas are real, and one of them is a genuine trap. This node reads its style bank from styles.json - lowercase - but the repo ships Styles.json with a capital S. On Linux that load silently fails, so the five style dropdowns come up empty (comfy.icu's schema for this node shows them with zero choices). The good news: custom strings, the toggles, and the presets all still work, because those live in the Python code, not the JSON. Only the style bank is dead. Rename the file to styles.json and it comes back. And yes, the two nodes in this pack read two different JSON files with two different shapes - a sign of how quickly this project came together.
The honest note: the thread that spawned this pack eventually pointed the asker at rgthree's Power Lora Loader instead, which is the maintained, far more powerful version of exactly this idea. Treat StringSwitchOpalSky as the lightweight learning-project take on it - fine for a workflow you're just playing with today, but if you're building something you'll live with for months, the rgthree route is the one people actually reach for. One harmless quirk: the pack's __init__.py declares a frontend folder that doesn't exist in the repo, so you may see a warning in the console at startup. Ignore it.
Inputs (18)
| Name | Type | Default | Description |
|---|---|---|---|
| use_custom_strings | BOOLEAN | true | — |
| use_styles | BOOLEAN | false | — |
| string_1 | STRING | — | |
| switch_string_1 | BOOLEAN | true | — |
| string_2 | STRING | — | |
| switch_string_2 | BOOLEAN | true | — |
| string_3 | STRING | — | |
| switch_string_3 | BOOLEAN | true | — |
| string_4 | STRING | — | |
| switch_string_4 | BOOLEAN | true | — |
| string_5 | STRING | — | |
| switch_string_5 | BOOLEAN | true | — |
| preset | COMBO | Custom | 4 options: Custom, Cinematic Noir, Fantasy Illustration, Retro Sci-Fi |
| Lighting_and_Atmosphere | COMBO | none | 0 options: |
| Artistic_Medium_and_Texture | COMBO | none | 0 options: |
| Cultural_and_Genre_Influences | COMBO | none | 0 options: |
| Composition_and_Style_Structure | COMBO | none | 0 options: |
| Photography_and_Realism | COMBO | none | 0 options: |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| concatenated_string | STRING | — |