Image Switch 🔄
A/B two image pipelines with one checkbox
- image_1
- image_2
- image
You've got two branches in a graph - a fast preview pass and a full-quality render, or two different post-processing chains - and you keep having to unplug one and plug in the other. Image Switch is the two-lane junction: one checkbox picks which of two IMAGE inputs flows out. Nothing else, no conditionals, no routing logic.
It's one of the four switch nodes in the Painting Coder Utils pack (the others cover text, masks, and latents). They're all the same shape, which is the point - you learn one and the other three are obvious.
How it works
use_first is a boolean, default true. Checked, it outputs image_1; unchecked, image_2. Both image inputs are optional, and the safety net matters: if you select a path that has nothing connected, the node returns a solid-color placeholder image (a plain 1024×1024 white-ish tensor) rather than erroring out. That keeps the graph alive, but be aware it's a real image leaving the node - a downstream node will happily process a blank block of color. If your output suddenly looks like a beige rectangle, an unconnected switch input is the first thing to check.
Inputs and output
use_first- the boolean selector.image_1,image_2- the two IMAGE inputs, both optional.- Output:
image- whichever one you picked, ready for a VAE decode, upscaler, or whatever's downstream.
Where you'll use it
The classic case is comparing two paths in one graph: different seeds, different samplers, or a raw render vs. a post-processed version, all converging on the same downstream nodes. Flip the switch, re-run, compare. It also works as a "skip the expensive step" gate - route the cheap image on one side and the refined one on the other.
Honest note: if you already run a switch-capable pack like rgthree, you don't strictly need this - its Switch nodes are more capable and cover multiple types in one interface. These are for when you want the dependency-light version that does exactly one job.
Install
ComfyUI Manager → search Painting Coder Utils, or:
cd ComfyUI/custom_nodes
git clone https://github.com/jammyfu/ComfyUI_PaintingCoderUtils.git
Restart ComfyUI. No models or keys anywhere in this pack - dependencies are numpy, Pillow, torch, and gradio, all already present in a working ComfyUI. Inheriting an old workflow? The v0.3.0 namespace rename is the usual culprit for "node not found"; jammyfu's fixer tool at docs/fix/workflow_fixer.html repairs the JSON.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| use_first | BOOLEAN | true | — |
| image_1opt | IMAGE | — | |
| image_2opt | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |