FEOperatorIf
A clean if/else for any wire in your graph
- true
- false
- output
At some point every ComfyUI graph becomes a set of decisions: if the seed is even, use this checkpoint; if this random bool came back true, inpaint instead of upscale. FEOperatorIf is the node you wire those decisions through. It takes a boolean condition and two candidate values, and passes through whichever one the condition selects.
The genuinely useful part is that it's any-typed. Most switch nodes in the ecosystem are typed - image switches, text switches, model switches. This one takes true and false as any type and returns whichever wins, so a single node can switch prompts, numbers, images, even whole conditioning pipes. One node, any wire.
Inputs and output
true- passed through whencondis true.false- passed through whencondis false.cond- the BOOLEAN deciding which one.
Output: output, exactly the chosen value, same type it came in as.
The gotcha that bites everyone once
Here's the part the node's simplicity hides: in ComfyUI, both true and false must be valid and executable. The graph doesn't know which branch you'll take until runtime, so it computes both inputs, runs everything feeding them, and only then discards the loser. That means:
- The losing branch's nodes still run. If you're using this to pick between two expensive samplers, you're paying for both.
- If the losing branch errors, the whole run dies - there's no lazy evaluation.
- You can't leave one input disconnected and "hope it's not needed." It will be needed, in the sense that it's missing.
This is the classic "if" node trap, and it's why people who need real branch skipping end up in Impact Pack's conditional world or use workflow-level muting instead. FEOperatorIf is for switching values, not for skipping computation. Keep that mental model and it's exactly what you want: cheap, any-typed, zero config.
Install
From fexli-util-node-comfyui:
cd ComfyUI/custom_nodes
git clone https://github.com/fexli/fexli-util-node-comfyui
cd fexli-util-node-comfyui
pip install -r requirements.txt
Or Manager → search fexli-util-node-comfyui → install → restart. No model downloads, no config.yaml needed (that's only for the pack's API-generation nodes).
If you just need to pick between two values of one type based on a condition, this is a tidy little node that earns its place. Just don't ask it to be a full control-flow system - that's not what it is.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| true | * | — | |
| false | * | — | |
| cond | BOOLEAN | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| output | * | — |