ReturnAorBValue
Return A or B Value (LogicGateEither) — ComfyUI-LogicUtils
- condition
- input1
- input2
- *
LogicGateEither is a switch. It takes a condition and two values, and it passes through one of the two depending on whether the condition is true or false. In plain terms it's an if-else for a single value: if this, use A, otherwise use B. Its display name in the menu is even blunter, "ReturnAorBValue," which tells you exactly what it does.
This is the node that lets a workflow make a choice. You've got a boolean toggle somewhere, or a computed flag, and you want the graph to use one setting when it's on and a different setting when it's off. Rather than building two separate workflows or manually rewiring, you feed both options into this node and let the condition pick. Choose between two resolutions, two prompts, two strengths, two of anything, off one switch. It's the smallest possible building block of branching logic, and it pairs perfectly with the boolean converter in this pack, which is how you turn some arbitrary value into the true/false this node wants.
It ships in ComfyUI-LogicUtils, aria1th's utility pack. aria1th is AngelBottomless, the trainer behind Illustrious XL, and the pack is his personal collection, so the node is terse and there's no real documentation beyond the name.
Inputs and outputs
Three inputs, all typed * (wildcard, so they take anything). condition is the value that decides. input1 and input2 are the two candidates, both defaulting to an empty string. The single output is *, whichever of the two inputs the condition selected. So the condition steers, and one of your two values comes out the other side.
One honest caveat: without documentation, which branch is "true" and which is "false" is something to confirm by testing rather than to assume. Feed it an obvious true and see whether input1 or input2 comes through, then wire the rest accordingly. It's a ten-second check and it saves a confusing debug session.
Installing it
- ComfyUI Manager: Custom Nodes Manager, search "ComfyUI-LogicUtils," install, restart.
- Manual:
cd ComfyUI/custom_nodes && git clone https://github.com/aria1th/ComfyUI-LogicUtils, then restart.
No models, no dependencies of note. The pack's optional auto-installer only runs behind COMFYUI_LOGICUTILS_AUTO_INSTALL=1 (disable with COMFYUI_LOGICUTILS_SKIP_INSTALL=1), and a value selector needs none of it.
The thing to understand
This selects a value, it doesn't prune a branch. Both input1 and input2 still get computed by whatever produces them; the node just chooses which result passes downstream. So if you were hoping to use it to skip an expensive part of the graph, that's not what happens, because ComfyUI still runs the upstream nodes on both sides. Everything that feeds this node executes, and then Either picks one. For choosing between two already-computed values it's exactly right; for genuinely skipping work you'd need a different approach, like muting or bypassing whole groups.
Get the branch direction confirmed once, remember that both sides still run, and this is a clean, reliable way to put a fork in a workflow.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| condition | * | 0 | — |
| input1 | * | — | |
| input2 | * | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| * | * | — |