ViewComfy - Conditional Select
ComfyUI's if/else, In One Node
- value_a
- value_b
- output
Every interesting ComfyUI workflow eventually hits the same wall: you want it to do this when something is true and that when it isn't, and the canvas has no if. The Conditional Select node from ViewComfy-Utils is that if. Feed it a boolean and two values, and it passes one or the other through. That's the entire node, and it's one of the most useful little things in the pack.
The inputs are exactly what you'd hope: condition (a BOOLEAN, default True), then value_a and value_b, both * wildcards so they accept literally any type - an image, a latent, a model, a string, whatever. The single output gives you value_a when the condition is true and value_b when it's false. No coercion, no type juggling, no surprises. It's a pure pass-through router.
How it slots into a real workflow: the pack's own example workflow is the clearest illustration of the pattern. Load an image, check its dimensions with a Compare node, and route through Conditional Select: if it's too large, pass the image along to be processed; otherwise pass along a "None" that a downstream optional input will simply ignore. The same shape handles model selection - flip a boolean and you're feeding the sampler either the fast checkpoint or the high-quality one - or parameter choice, or positive-prompt swapping. It's the mechanical heart of every "conditional" workflow in the ecosystem, and the KB's node-plumbing essay calls this exact shape the A/B switch: a selector that passes whichever input you point it at.
The thing to keep straight is what it does not do. It picks a value; it does not block execution. Both branches feeding it have already run by the time it decides, so if one of your two candidates comes from an expensive pipeline, you're paying for both. For actual conditional execution - where the losing branch never runs - you want the Anything Inversed Switch from the same pack, which blocks non-selected paths outright. Choose based on what you're actually trying to save: compute (inversed switch) or code (this).
Practical notes: if you leave value_a or value_b unwired, that side just returns None - which is a feature, because None into an optional downstream input reads as "not connected" and gets skipped by fallback logic. And the condition widget can be wired from any boolean source, so a Compare node upstream turns this into a live, re-evaluating branch rather than a hand-set toggle.
Installation is standard for the pack: ComfyUI Manager → search "ViewComfy-Utils" → install, or clone manually:
cd ComfyUI/custom_nodes
git clone https://github.com/ViewComfy/ViewComfy-Utils
Restart ComfyUI after. No extra dependencies beyond stock ComfyUI, no model downloads, MIT licensed - a zero-risk install from a team that built these nodes for their own app platform. If you're just getting into conditional workflows, this is the node to reach for first: it's the smallest possible step from "pipeline" to "program."
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| condition | BOOLEAN | true | — |
| value_aopt | * | — | |
| value_bopt | * | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| output | * | — |