Nodes/ComfyUI_Custom_Switch/Automatic Image Switch (3 inputs)
ComfyUI Node

Automatic Image Switch (3 inputs)

Pick whichever of three images actually shows up

By tritant·Created 11 months ago·Updated 10 months ago· 16
Automatic Image Switch (3 inputs)
  • image_1
  • image_2
  • image_3
  • IMAGE

You've built a workflow with a couple of optional branches - maybe an upscale path that only sometimes runs, maybe a face-detail pass you toggle on for close-ups - and now you need to feed one image downstream no matter which branch actually fired. AutomaticImageSwitcher is the dumbest possible fix for that, in the best way: give it up to three IMAGE inputs, and it hands back whichever one is actually populated. No boolean, no index, no dropdown to configure. It just checks.

How it works

The logic is exactly three lines: if image_1 has something connected, return it. Otherwise check image_2. Otherwise check image_3. If none of the three produced an image - all disconnected, or the branch feeding them didn't run - it doesn't error out. It quietly hands back a blank 64×64 black square instead, so the rest of your graph stays valid even when nothing upstream fired.

That priority order is fixed, not something you configure. Whatever's wired into image_1 wins outright the moment it produces a real image, regardless of what's sitting in 2 or 3. So the way you use this node is: wire your first-choice / highest-priority source into image_1, your fallback into image_2, and a last-resort default into image_3 if you have one. It's less a "switch" in the boolean-input sense and more a priority queue with three slots.

The inputs and outputs that matter

  • image_1, image_2, image_3 - all optional IMAGE inputs. Leave any of them disconnected; the node handles gaps fine, that's the whole point.
  • Output: IMAGE - one image out, whichever of the three actually resolved. Wire it straight into whatever consumes a single image downstream (a Save Image node, another sampler, a preview).

There's no is_output_node flag set and no widget to configure - this is a plain pass-through data node, not a control-panel node like some of its siblings in the same pack. You wire it in like anything else.

How to install it

Easiest path is ComfyUI Manager: search for ComfyUI_Custom_Switch, install, restart. Manually, it's the standard drop-in:

cd ComfyUI/custom_nodes
git clone https://github.com/tritant/ComfyUI_Custom_Switch

then restart ComfyUI. There's no requirements.txt in the repo and nothing to download - it only needs torch, which ComfyUI already ships with, so there's genuinely nothing else to set up.

Worth knowing going in: this is a small, one-person pack (built by the GitHub user tritant, ~16 stars, quiet since a single push in October 2025). It's not the pack everyone's running, but it's not a ghost repo either - the same author also maintains a more popular layer/mask/text utility pack that's gotten warm feedback on r/StableDiffusion, so there's a real person behind it who ships working nodes.

Common issues & troubleshooting

It keeps using image_1 even though I wanted image_2 to win. That's by design - the priority order isn't configurable. If image_1 is connected and produces an image, it always wins. If you actually want to test the fallback, disconnect image_1 (or make sure the branch feeding it genuinely doesn't run) rather than looking for a priority setting that doesn't exist.

I'm getting a tiny black square in my output. That means none of the three inputs produced an image - all three disconnected, or whatever was supposed to feed them was skipped, bypassed, or muted upstream. It's not a crash, it's the node's deliberate "nothing to show" fallback. Trace back to whichever branch was supposed to run and check it actually executed.

Can't find it in Manager's search. It's a small enough pack that Manager's index may lag; search the exact repo name ComfyUI_Custom_Switch rather than a looser term, or fall back to the manual git clone above.

CategoryLogic

Inputs (3)

NameTypeDefaultDescription
image_1optIMAGE
image_2optIMAGE
image_3optIMAGE

Outputs (1)

NameTypeDescription
IMAGEIMAGE