ComfyUI Node Runs on cloud

easy ab

Send an input down path A or path B with one boolean

By yolain·Created 3 years ago·Updated 8 days ago· 2,633
easy ab
  • in
  • A
  • B
A or Btrue

A tiny fork in the road. easy ab takes one input and routes it out of either the A output or the B output depending on a single boolean toggle. That's it. It's the "if this, go left, else go right" primitive for a ComfyUI graph.

Small as it is, it's the kind of node that makes conditional workflows readable. Instead of duplicating a whole branch or manually swapping cables, you flip one switch - or better, drive it from another node - and the data flows down whichever leg you chose.

How it works

The in value gets passed to output A when the toggle is true and to output B when it's false (the other output stays empty for that run). Because the input and both outputs are wildcard-typed, it routes literally anything - an image, a latent, a model, a string. Only the chosen branch carries data downstream.

The inputs and outputs that matter

  • A or B (BOOLEAN, default true) - the switch. True sends to A, false sends to B. This is the whole control surface, and the interesting move is to not set it by hand: wire it from a comparison or logic node so the routing decides itself.
  • in - the thing to route (any type).
  • A and B - the two exits. Wire each to the branch it should feed.

How to install it

ComfyUI Manager: search ComfyUI-Easy-Use, install, restart. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/yolain/ComfyUI-Easy-Use

then install.bat / pip install -r requirements.txt, restart. No models - pure logic.

Common issues & troubleshooting

The unused branch errors. When the toggle picks A, output B has nothing. If a node downstream of the unused branch is set up as required, ComfyUI may complain it got no input. Design each branch so it only runs when it's the selected one - that's the whole point of routing, and it's what keeps the idle side from executing.

ab vs. indexSwitch. easy ab is a two-way split by boolean; easy imageIndexSwitch is a many-way pick by number. If you've only got two paths and a true/false decision, ab is cleaner. More than two, or an image-specific selection, use the index switch.

It routes, it doesn't compute the condition. easy ab won't decide whether A or B for you - it only acts on the boolean you give it. The "smarts" come from whatever you wire into A or B. Pair it with the pack's logic/compare nodes for an actual if/else.

Chaining for a small decision tree. Need three or four outcomes? You can nest a couple of these, but past two decisions it gets fiddly fast - reach for an index switch instead of a tree of ab nodes.

CategoryEasyUse/Logic

Inputs (2)

NameTypeDefaultDescription
A or BBOOLEANtrue
in*

Outputs (2)

NameTypeDescription
A*
B*