Any Switch Image
The tiny fallback image switch
- images
- image
Any Switch Image is a one-node pack that answers a question you will eventually hit in every real workflow: "I have a few optional upstream branches that might or might not produce an image - which one do I feed to the thing downstream?" The node walks its inputs top to bottom and hands you the first one that actually has an image in it. No selector, no config, no key, no dependencies. If your graph already contains the answer, it just picks it for you.
This is the fallback shape of switch, not the A/B kind. A selector switch asks you to choose; this one routes automatically - whichever branch is live wins. The classic use is a graph with several mutually exclusive paths - say, an inpaint mask that might come from a dedicated mask-generation branch, from a manual load, or be absent entirely. Wire all three in priority order, leave the ones you're not using muted or disconnected, and the live branch flows through without you touching anything. Muted node links are ignored, and unconnected inputs are skipped, so you can leave a slot empty and the node just moves on.
The mechanism is the same first-non-null pattern that makes rgthree's Any Switch the community default - ComfyUI treats an unwired optional input as None, and this node literally returns the first non-None image in its list. The difference: rgthree's is ANY-typed and routes anything, while this one is typed strictly as IMAGE, so it can't silently misroute a latent or a model. For an image-only fallback that is a feature, not a limitation - the graph stays type-checked.
The inputs that matter. There's exactly one input socket, images, and it's an autogrow input backed by up to a hundred optional slots (image_01 through image_100). You don't wire the wrapper; you add individual image inputs and connect them in priority order, highest priority on top. That ordering is the whole game - the node evaluates strictly top-down, so if the top slot has an image, nothing below it ever gets looked at. The single output, image, is a plain IMAGE tensor that plugs into anything downstream expecting one.
Installing it is close to free. This pack has no requirements.txt, no models to download, no heavy deps - just one node in one file:
cd ComfyUI/custom_nodes
git clone https://github.com/palealloy2999-prog/ComfyUI-AnySwitchImage
Restart ComfyUI and it'll appear under the image category (or search "Any Switch Image"). ComfyUI Manager also has it, though for a pack this small a plain clone is honestly faster.
Two things worth knowing before you commit to it. First, it's written against ComfyUI's newer V3 backend authoring API (comfy_api.latest), which is why there's no NODE_CLASS_MAPPINGS in the source - that's "it's new," not "it's broken." Second, this is a tiny, fresh pack: a single July 2026 commit by a solo author, with a bilingual EN/JP README and basically zero community footprint yet. The behavior is simple enough that this is low-risk, but if you want a battle-tested switch with years of corner cases filed against it, rgthree's Any Switch is the boring, reliable choice. What this one buys you is exactly nothing extra - no suite, no context bus, no seed nodes, just the one behavior, small and typed. There's a real argument for that when you want a workflow you can hand to someone who hasn't installed four packs.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| images | COMFY_AUTOGROW_V3 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |