Shima Choice Switch
A toggle switch that knows boolean, integer, and string
- choice
- boolean
ComfyUI's boring boolean toggle gets the Shima treatment in Choice Switch: a chunky, color-coded physical toggle rendered right on the canvas. Flick it and it hands a value downstream - and here's the useful part, it can hand out a boolean, an integer, or a string depending on the mode you set. It's a two-way A/B switch with a face, and for workflows where you flip between two prompt variants or two settings by hand, it's nicer to look at and easier to find than a bare checkbox.
How it works
Under the hood it's a two-position switch with a hidden integer (value, 0 or 1) tracking which side is up. The mode dropdown decides what the primary output actually is:
- Boolean - outputs
TrueorFalse. - Integer - outputs
1or2. - String - outputs whichever of
option_1_str/option_2_stryou've filled in.
The two option strings are both visible as widgets, so in string mode this doubles as a tiny inline label: "ON" / "OFF", "SDXL" / "Flux", whatever you're choosing between. The option_1_color and option_2_color widgets tint the toggle so you can color-code at a glance - the defaults are a calm blue for option 1 and a warning red for option 2.
Two outputs come off the node. The first, choice, is the polymorphic value (its type matches your mode). The second, boolean, is always a plain boolean - True when option 1 is selected, False for option 2. That second output is the quiet workhorse: you can wire it into a Highway Detour, a conditional, or anything else that wants a clean True/False signal, regardless of what mode the switch is in.
The inputs that matter
Honestly, only a few widgets matter on a normal day:
- mode - set once: Boolean, Integer, or String.
- value - the switch position. It's marked hidden in the schema, meaning the frontend toggle drives it rather than you typing numbers.
- option_1_str / option_2_str - the labels, which double as the string outputs.
- layout (Wide / Stacked) and font_size - pure cosmetics.
Installing it
Part of the Shima pack. ComfyUI Manager → search Shima, or:
cd ComfyUI/custom_nodes
git clone https://github.com/KDB-USJP/shima_wf.git Shima
Restart ComfyUI; first launch auto-installs the pack's deps and companion repos (ComfyUI-Impact-Pack, cg-use-everywhere).
Common issues
- "The switch doesn't stay how I left it." Choice Switch is marked as an output node (
OUTPUT_NODE = Truein the source), so it re-executes even when nothing's connected downstream. That's expected; the position itself is what you set by hand. - "My string mode returns the wrong label." Remember option 1 maps to
True/1, option 2 toFalse/2. If your labels feel swapped, you've got the mental model backwards - which side is "option 1" follows the value, not the color. - It's a manual switch, not a fallback. Unlike rgthree's Any Switch, this won't auto-pick the first non-null input. It always returns the side you selected. If you want the graph to decide, look elsewhere.
For a quick, legible way to flip a setting by hand - and get a clean boolean out for free - this does the job without ceremony. The styling is the point; the logic is refreshingly simple.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| mode | COMBO | Boolean | 3 options: Boolean, Integer, String |
| value | INT | 10–1 | — |
| option_1_str | STRING | TRUE | — |
| option_2_str | STRING | FALSE | — |
| option_1_color | STRING | #3a5a7c | — |
| option_2_color | STRING | #571a1a | — |
| layout | COMBO | Wide | 2 options: Wide, Stacked |
| font_size | INT | 188–24 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| choice | * | — |
| boolean | BOOLEAN | — |