Any If Else
One checkbox, two wires, and the branch ComfyUI doesn't otherwise have
- any_1
- any_2
- any_out
ComfyUI is a straight line. Loader to sampler to save, no if anywhere in it - which is why "how do I conditionally do X?" and "is there an if/else node?" are among the most repeated questions in r/comfyui. Any If Else is the smallest honest answer to that question. One boolean, two inputs, one output, and no cleverness beyond that.
What it actually is
The neat way to tell it apart from its packmate Any Switch: Any Switch chooses where a value goes. Any If Else chooses which value wins. This one has a single output, and it hands you one of the two things you wired into it.
The whole implementation is one line:
def select(self, any_1, any_2, condition):
return (any_1 if condition else any_2,)
So it's a multiplexer, not magic. condition true gives you any_1; false gives you any_2. The default is true, which means a freshly dropped node passes the first input straight through until you flip it.
The inputs and the one output
- any_1 (required, wildcard) - the value you get when
conditionis true. - any_2 (required, wildcard) - the value you get when it's false.
- condition (BOOLEAN, default true) - the toggle on the face of the node. If you want something upstream to make the call rather than your mouse, right-click it and convert it to an input; any BOOLEAN output will drive it.
- any_out (wildcard) - whichever value won. There's only this one output, so nothing downstream has to guess which branch was live.
Both inputs are required, including the one that's always thrown away. Leave any_2 unwired and ComfyUI refuses to run the node - you get a validation error, not a shrug. If what you want is "this value, or nothing", wire a real placeholder in: the pack's own Empty String node, or a core Primitive.
Sockets are wildcard ("*"), which is ComfyUI's type-system escape hatch - the node declares VALIDATE_INPUTS returning true, so the backend skips type-checking a socket it can't reason about. That's fine when both branches are the same kind of thing (two IMAGEs). When they aren't - an IMAGE on one side, a LATENT on the other - nothing stops you wiring it up, and the error surfaces at whichever node eats any_out, several nodes away from where you went wrong.
What it is not: a muter
Both branches execute on every run. The node drops one of the results after both were already computed. ComfyUI only defers work when a node declares its inputs lazy, and there is no lazy flag anywhere in this pack - I checked the source rather than the README. So using Any If Else to choose between two upscalers does not save you an upscale. For skipping compute, bypass the node or mute its group (rgthree's Fast Groups Bypasser is the usual tool for that).
The upside of being a plain pure function is that it plays nicely with ComfyUI's cache - flipping condition is what re-runs the graph.
Installing it
The pack is brand new (first commits September 2026), MIT licensed, and - the good part - has zero Python dependencies. pyproject.toml declares an empty dependency list and there's no requirements.txt to install, so there's nothing here that can fight your torch build. It also publishes itself to the ComfyUI registry automatically, which means Manager can find it.
Manager → search ComfyUI Useful Stuff Nodes → Install → restart ComfyUI. Or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/ArtemKo7v/ComfyUI-UsefulStuffNodes
then restart ComfyUI. This node is pure backend, so it doesn't need the browser-side extras the pack's multi-slot nodes use - but hard-reload the tab anyway (Ctrl+Shift+R) if you're using any of those in the same workflow.
Where people get tripped up
"Missing node" on a shared workflow. The JSON stores the class name ArtemKo7vUsefulStuffNodesAnyIfElse, and the pack is brand new, so plenty of UIs won't resolve it. Install the pack; the wiring comes back intact.
Silent branch confusion. There's no wrong socket to pick on the way out, but there is a wrong input - it's easy to swap any_1 and any_2. Flip the default true and watch which image decodes: that tells you which socket is the "true" one.
Enabled Nodes 2.0. This is a LiteGraph-era pack with frontend extensions, the same class of third-party node the Nodes 2.0 Vue rewrite has been breaking. If things render oddly, the standing workaround is to leave Nodes 2.0 switched off.
Verdict: dull, which is the compliment here. It does one thing exactly as documented, and it's the right tool when you want a toggle you can flip next Tuesday without rewiring anything.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| any_1 | * | — | |
| any_2 | * | — | |
| condition | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| any_out | * | — |