Nodes/ComfyUI Easy Use/easy imageSwitch
ComfyUI Node Runs on cloud

easy imageSwitch

Route one of two images with a boolean

By yolain·Created 3 years ago·Updated 9 days ago· 2,633
easy imageSwitch
  • image_a
  • image_b
  • IMAGE
booleanfalse

A tiny, honest utility: two image inputs, one boolean, and the boolean decides which image comes out. easy imageSwitch is how you put a fork in an image pipeline - "use this version if the flag is on, otherwise use that one" - without rewiring the graph by hand every time. It looks trivial, and it is, but conditional routing is exactly the kind of glue that makes a workflow flexible instead of hardcoded.

What it's for

The point is picking between two image branches at runtime based on a boolean you control (or that another node computes). Say you have a workflow that can either run a heavy detail pass or skip it - you feed the detailed image into one slot, the plain image into the other, and flip the boolean to choose. Or you're A/B testing two preprocessing paths and want to switch which one feeds your sampler without deleting connections. Because the choice is a boolean, you can drive it from any logic node, a checkbox, or a value computed upstream, which is where it gets genuinely useful in bigger graphs.

The inputs and outputs that matter

There are only three inputs, and that's the whole node:

  • image_a and image_b - the two image streams to choose between.
  • boolean (default false) - the selector. It picks between the two inputs; with the default false it passes one through, flip it to true for the other. If you're ever unsure which way it maps, wire two obviously-different images in and toggle it once - you'll know in one run, and then it's locked in your head.

The single output is IMAGE - the chosen one - which you wire onward exactly as if it came straight from the winning branch.

Installing it

Comes with the pack; nothing node-specific to fetch. Install ComfyUI-Easy-Use through ComfyUI Manager (search ComfyUI Easy Use, install, restart) or clone it:

cd ComfyUI/custom_nodes
git clone https://github.com/yolain/ComfyUI-Easy-Use

Install requirements, restart.

Worth knowing

The thing to understand about switches in ComfyUI is both branches may still execute. A switch chooses which output to pass on, but it doesn't automatically stop the unpicked branch from computing - so if image_b is fed by an expensive chain, that chain can still run even when you've selected image_a. If your goal is to skip heavy work, a switch alone won't save you the compute; you'd want to bypass or mute the unused branch (rgthree's group toggles are handy for that) rather than rely on the switch to prune it. As a pure "which of these two results do I forward" tool, though, easy imageSwitch does the job cleanly. Keep both inputs the same type (they're both IMAGE here, so you're fine) and it just works. For switching more than two inputs, or non-image types, look at the pack's index-switch nodes instead.

CategoryEasyUse/Logic/Switch

Inputs (3)

NameTypeDefaultDescription
image_aIMAGE
image_bIMAGE
booleanBOOLEANfalse

Outputs (1)

NameTypeDescription
IMAGEIMAGE