Nodes/was-node-suite-comfyui/Number Input Switch
ComfyUI Node Runs on cloud

Number Input Switch

Pick between two numbers with a boolean

By WASasquatch·Created 3 years ago·Updated about a year ago· 1,812
Number Input Switch

      This is a two-way selector for numbers. You wire in two number values, flip a boolean, and it passes one of them through. The WAS README's description is one line - "Switch between two number inputs based on a boolean switch" - and that's genuinely all it does. It's a small node, but small routing nodes like this are what turn a static graph into one that can behave differently on demand.

      The reason it earns its place: ComfyUI graphs are otherwise fixed. Every wire always carries its value. A switch breaks that - now a single boolean decides which of two numbers reaches downstream, so you can toggle between two step counts, two CFG values, two resolutions, whatever, without rewiring anything. Drive that boolean from a logic node and the workflow starts making decisions.

      How it works

      It takes two numbers, A and B, and a boolean. The boolean's state chooses which one comes out the single output. False sends one, true sends the other. That's the entire mechanism - it's a multiplexer, the number version of the pack's whole family of Input Switch nodes (there's one for images, latents, models, VAEs, and more, all following the same boolean pattern).

      The inputs and outputs that matter

      • Two number inputs - the two candidate values.
      • A boolean switch - the selector; its true/false state decides which number passes through.
      • One number output - the chosen value, wired to wherever the number is needed (a seed, a step count, a math node).

      I'm describing this from the README's stated behavior rather than a formal schema, so I won't invent exact port labels - but the two-in, boolean-selector, one-out shape is the whole node.

      How to install it

      Bundled in the WAS Node Suite:

      • ComfyUI Manager: search was-node-suite-comfyui, install, restart.
      • Manually: cd ComfyUI/custom_nodes && git clone https://github.com/WASasquatch/was-node-suite-comfyui/, then pip install -r requirements.txt against your ComfyUI Python, and restart.

      No model, no heavy dependency - it's a routing node.

      Common issues

      The most common trip-up is thinking the switch stops the unselected branch from running. It doesn't - this picks which value flows onward, but both upstream branches still execute if ComfyUI needs to evaluate them. If you're trying to skip an expensive computation entirely, a value switch is the wrong tool; you want to restructure the graph or use a bypass, not route around it after the fact.

      The other is getting the boolean's polarity backwards - is true A or B? It's easy to wire it once, get the opposite of what you expected, and assume the node's broken. It isn't; just flip the boolean (or invert it with WAS's Logic NOT) and you're set. Pair it with Number Input Condition if you want the boolean to come from an actual comparison rather than a manual toggle.

      And the pack-wide caveat: WAS Node Suite has been retired since December 2023 - used constantly, maintained never. If a ComfyUI update makes every WAS node vanish with an "Import Failed", that's suite-level dependency drift, not this node. Re-run requirements.txt against the correct Python environment (or the bundled install.bat) and restart.

      Categoryx

      Inputs (0)

      No inputs

      Outputs (0)

      No outputs