Any Switch (Any)
The first non-empty value wins
- any_01
- any_02
- any_03
- any_04
- any_05
- any
Somewhere in every workflow there's a decision that isn't really a decision: "use the tagger output if there is one, otherwise fall back to this default." ComfyUI has no built-in way to say that - you'd normally build a whole conditional chain. Any Switch (Any) is the pack's small answer: up to five inputs of any type, and the node returns the first one that isn't empty. First valid value wins, that's the whole job.
The (Any) in the name is doing real work - the inputs and output are all match-type sockets, so you can route images, strings, latents, conditioning, whatever through the same switch without worrying about types matching. It's a fallback junction, not a type-aware router.
How it works
The node checks any_01 through any_05 in order and returns the first one it considers "valid." The definition of invalid is the part worth reading, because it's what makes the node safe to use: None, a NaN float, an empty/whitespace string, and the literal strings "none", "null", and "nan" all count as invalid. Everything else - including 0, False, and an empty list - counts as valid and stops the scan.
That last bit matters. A lot of nodes in this ecosystem return a sentinel like "none" when they have nothing to say, and this switch understands those sentinels. So the classic pattern is: connect a tagger or an optional-prompt node to any_01, connect your hardcoded default to any_02, and let the switch pick whichever one actually has content.
The source even unwraps single-element lists and internal __value__ wrappers before judging, which is the kind of defensive detail you only add after watching a real pipeline hand you an empty singleton.
The inputs and output
Five optional inputs - any_01 through any_05 - scanned top to bottom. One output: any. If every input is invalid, the output is... the first input's empty value, effectively nothing; there's no separate "give me a guaranteed fallback" output, so keep a real default in the last slot.
Where the ecosystem's tension shows up
ComfyUI's community has an actual argument about nodes like this. The knowledge base records a "Please Stop using the Anything Anywhere extension" backlash - a popular any-to-any router drew criticism for making workflows impossible to debug, since a wire can silently carry the wrong type. That critique mostly targets routers that erase type information. This node is more conservative: it's type-transparent (the input type is whatever you feed it), and its "first non-empty" semantics are predictable. Still, the same debugging advice applies - label your inputs and keep the switch near the top of the graph, or you'll be guessing which branch fired three weeks later.
The honest caveat
It's a five-input fallback with no per-slot condition, no UI toggles, and no logging. If you need a switch you can flip by hand, this isn't it - you'd want an Optional Switch or a bypass group instead. This node's job is purely mechanical: pick the first live value so the rest of the graph doesn't have to branch.
Installing
Part of kinorax/comfyui-info-prompt-toolkit:
cd ComfyUI/custom_nodes
git clone https://github.com/kinorax/comfyui-info-prompt-toolkit.git
cd comfyui-info-prompt-toolkit
pip install -r requirements.txt
or install "Info-Prompt-Toolkit" via ComfyUI Manager, then restart. No model files, no dependencies - a pure utility, and one of the smallest nodes in the pack.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| any_01opt | * | — | |
| any_02opt | * | — | |
| any_03opt | * | — | |
| any_04opt | * | — | |
| any_05opt | * | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| any | * | — |