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

Image Input Switch

Flip between two images with a boolean

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

      A tiny, boring, genuinely useful node. It takes two image inputs and a true/false flag, and passes through one of them. That's the whole thing. Flip the boolean and the downstream half of your graph gets image A or image B without you rewiring anything.

      The reason this exists is that ComfyUI graphs get big, and re-plugging wires every time you want to test "with upscale vs without" or "photo A vs photo B" is tedious and error-prone. A switch lets you build both paths once and toggle between them from a single control - the same instinct behind rgthree's fast muters and bypassers, just at the level of one wire instead of a whole group.

      How it works

      There's no image processing here at all - it's pure routing. The node reads the boolean, and returns whichever of its two image inputs the boolean selects. Think of it as an if statement for pixels. Because it passes the tensor straight through untouched, it costs basically nothing and never degrades the image.

      Where it earns its keep is in reusable workflows. Say you have a graph that sometimes starts from a loaded photo and sometimes from a freshly generated latent decoded to an image. Wire both into an Image Input Switch, drive the boolean from a single toggle, and now one control reconfigures the whole run. You can chain several switches off the same boolean to move multiple wires in lockstep.

      The inputs and outputs that matter

      Three things go in, one comes out:

      • Two IMAGE inputs - call them A and B. These are your two candidate images.
      • A boolean - the selector. False sends A through, true sends B (or the other way round; glance at the tooltip in your build). This is the only control you actually set, and you'll usually feed it from a boolean/logic node rather than typing it, so it can be driven by other logic.

      The single output is an IMAGE - whichever input won. It wires into anything that takes an image: a VAE encode, an upscaler, a preview, a save node.

      Installing it

      This ships in WAS Node Suite, so you install the pack. ComfyUI Manager is the easy route: search WAS Node Suite, install, restart. Manually:

      cd ComfyUI/custom_nodes
      git clone https://github.com/WASasquatch/was-node-suite-comfyui
      

      then install its requirements.txt against your ComfyUI Python and restart.

      Common issues

      Honestly there's little to break in the switch itself - it's a few lines of routing logic. The problems you'll hit are pack-level. WAS Node Suite has been retired since December 2023 (the author ran out of time), so it doesn't self-heal against dependency drift. The classic failure is the whole suite showing "Import Failed" after you update ComfyUI: WAS downgrades certain packages for compatibility, ComfyUI's update bumps them back, and the import breaks. When that happens every WAS node disappears at once, this switch included - so if it's suddenly gone, don't hunt for the node, fix the import by reinstalling the pack's requirements against the correct venv (the bundled install.bat will find it).

      One design note, not a bug: switches are convenient but they can make a graph harder to read for the next person, in the same way the "Anything Anywhere" routing approach draws criticism - a wire that changes destination based on a hidden toggle is a wire you have to think about. Label your booleans. A switch with a clear name ("use_upscale?") is a feature; five unlabeled ones are a debugging session. If you just need to disable a branch rather than pick between two, a bypass/mute might read cleaner than a switch.

      Categoryx

      Inputs (0)

      No inputs

      Outputs (0)

      No outputs