Nodes/ComfyUI-AutoFlow/Condition Assignment
ComfyUI Node

Condition Assignment

One boolean, five outputs — the branch node for people who hate wiring values twice

By ZXL-Xinram·Created about a year ago·Updated 9 months ago· 4
Condition Assignment
  • image_true
  • image_false
  • any_true
  • any_false
  • string
  • int
  • float
  • image
  • any
conditiontrue
string_truetrue
string_falsefalse
int_true1
int_false0
float_true1.00
float_false0.00

ComfyUI doesn't have if/else. You can fake branching with switch nodes, but they only switch one wire at a time, so a workflow that needs to change a filename, a number, and a strength in the same breath becomes a tangle of switches. Condition Assignment is the pack's answer: feed it one boolean and it hands back five outputs - a string, an int, a float, an image, and a wildcard "any" value - each already resolved to the true- or false-branch value you configured.

Think of it as the value-routing half of an if/else, designed to be fed by the pack's own Condition Checker.

How it works

Dead simple under the hood: a boolean condition picks one of two columns. True returns every *_true value; false returns every *_false value. All five outputs are computed every run - the unused ones are just never connected.

Inputs

  • condition - the boolean that decides the branch. Wire it from a Condition Checker, a seed comparison, anything that emits a BOOLEAN.
  • string_true / string_false, int_true / int_false, float_true / float_false - the required pairs. Defaults are true=1/1.0, false=0/0.0, so it works as a plain boolean-to-number converter even if you touch nothing else.
  • image_true / image_false (optional) - pick one of two images. Good for routing a preview or a mask.
  • any_true / any_false (optional) - wildcard inputs via the classic AlwaysEqualProxy("*") trick, so you can route literally any type through: a latent, a model, a CONDITIONING, a path string. This is the one you'll actually reach for when a switch node's typed inputs won't accept what you're passing.

Outputs

string, int, float, image, and any. Same order every time. The any output is the passthrough of whichever branch you selected.

Install

Standard pack install - ComfyUI Manager (search "ComfyUI-AutoFlow") or:

cd ComfyUI/custom_nodes
git clone https://github.com/ZXL-Xinram/ComfyUI-AutoFlow

Restart after. No models, no extra Python deps beyond what ComfyUI ships.

Where people get burned

  • The any inputs are optional but the node still has them. Leave them disconnected and the outputs are still emitted - with the defaults or nothing. Not a bug, just easy to forget.
  • Only one branch executes meaningfully. Because both columns are computed, you can't use this as a safety gate that prevents an expensive node from running. For actually skipping work, you want a bypass/switch that routes around the expensive node, not this.
  • It's a young pack. Zero community lore yet, so there's no stack of shared workflows to crib from. The node itself is trivial enough that this doesn't matter much.

If you're building any workflow that changes behavior based on a condition - pick a prompt when the input is empty, choose CFG by resolution, select a model by flag - this is the cleanest one-wire way to carry that decision through the graph.

CategoryAutoFlow/Utilities

Inputs (11)

NameTypeDefaultDescription
conditionBOOLEANtrueCondition to determine output values
string_trueSTRINGtrue
string_falseSTRINGfalse
int_trueINT1-999999–999999Integer value when condition is true
int_falseINT0-999999–999999Integer value when condition is false
float_trueFLOAT1.00-999999–999999Float value when condition is true
float_falseFLOAT0.00-999999–999999Float value when condition is false
image_trueoptIMAGEImage value when condition is true
image_falseoptIMAGEImage value when condition is false
any_trueopt*Any type value when condition is true
any_falseopt*Any type value when condition is false

Outputs (5)

NameTypeDescription
stringSTRING
intINT
floatFLOAT
imageIMAGE
any*