Ino Bool To Switch
The odd little mapping that feeds switch nodes
- INT
Ino Bool To Switch does a deceptively small thing: it turns a boolean into an integer, but not the integer you'd guess. true becomes 2, false becomes 1, and when the node is disabled it outputs -1. The mapping is the whole story, so let's not rush past it - most beginners would write true→1, false→0. This node deliberately doesn't.
The reason is a ComfyUI quirk: in the Ino pack's own switch node (InoSwitchOnInt), a 0 index is ambiguous or treated as "no selection," so boolean-driven switching uses 1 and 2 instead of 0 and 1. True→2, false→1 keeps both branches addressable. And the disabled state returning -1 is a distinct sentinel: it's neither branch, so downstream logic can tell "this node was deliberately off" apart from "this node ran and the answer was false." That's the kind of thing that only matters in automation, where a silent false can send a batch down the wrong path for hours.
How it works
It's a three-line transform: if enabled is off, return -1; otherwise return 2 for true, 1 for false. No state, no side effects. The value slots straight into any int-indexed switch input - wire a boolean from a comparison or a detect node into this, and the output picks which branch a switch takes. If you're not using a switch that expects 1/2 indexes, you can still use it as a slightly unusual boolean-to-int converter, just be aware of the mapping before you feed it into generic math.
Inputs and outputs
- enabled - off forces -1 regardless of the boolean.
- input_bool - the boolean being converted.
Output: INT - 2, 1, or -1 as described.
Installing it
Part of ComfyUI-InoNodes (Inoland). ComfyUI Manager → search "ComfyUI Ino Nodes" → install → restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/nobandegani/comfyui_ino_nodes
cd comfyui_ino_nodes
pip install -r requirements.txt
Restart after. Requires inopyutils (auto-installed) and a current ComfyUI; no keys or downloads.
Common issues
The trap is assuming the mapping you're used to. If you feed this node's output into a switch that expects 0/1, everything will be off by one branch - check the switch's indexing convention first. And if you're using the enabled toggle as a manual override, remember the -1 sentinel only helps if your downstream switch actually handles it; a switch that doesn't know about -1 will just pick whatever branch the index falls to. When in doubt, log the output of this node and see exactly what your graph is sending.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| enabled | BOOLEAN | true | — |
| input_bool | BOOLEAN | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| INT | INT | — |