Nodes/Boyonodes/Boyo Compare
ComfyUI Node

Boyo Compare

A tiny boolean for loop decisions — 'is it done yet?' as a node

By DragonDiffusionbyBoyo·Created 2 years ago·Updated 26 days ago· 16
Boyo Compare
  • a
  • b
  • boolean
comparisona == b

Boyo Compare is a single-purpose logic node: take two values, run a comparison, output a true/false. That's it. No image processing, no model loading, just a < b, a == b, and friends producing a BOOLEAN. It belongs to that quiet family of nodes that never appears in a showcase workflow but makes conditional behavior possible in the first place.

Why would you want it? Because loops are dumb. A for loop runs a fixed number of times, and that's often the wrong question - usually you want to stop when something is true. Has the counter hit the target? Is the accumulated latent good enough? Did this iteration change anything? Boyo Compare is the decision point that turns "run 20 times" into "run until the condition is met." In ComfyUI, where there's no real if statement, a boolean from a compare node is the closest thing you get to a branch.

How it works

Three inputs, one output. a and b are wildcard-typed (*) - ints, floats, even strings if the comparison makes sense - and comparison is a dropdown of the six classics:

  • a == b
  • a != b
  • a < b
  • a > b
  • a <= b
  • a >= b

The output boolean (BOOLEAN) is the result. Wire it into a loop's reset or condition logic, a switch, or anything that branches on a true/false. With ints and floats it does exactly what you expect; comparing strings is supported but string </> is lexicographic, which surprises people - if you want alphabetical ordering, fine, just know it's there.

Typical use

The author built it to sit inside the Boyonodes loop family - pair it with Boyo For Loop Start's index output to stop a loop early, or with a counter node to detect "we've done enough." A common pattern:

BoyoForLoopStart (index) ──┐
                           ├─▶ BoyoCompare (a=index, b=target, comparison="a >= b")
BoyoLoopReset (counter) ───┘          │
                                     boolean

a and b both default to 0, so unconnected inputs silently compare zeroes - remember to actually wire them, because a compare node with both inputs dangling always says 0 == 0, and that's a yes that'll loop forever if you trust it.

Installation

Part of Boyonodes, no extra dependencies:

cd ComfyUI/custom_nodes && git clone https://github.com/DragonDiffusionbyBoyo/Boyonodes

restart, find it under Boyo/Logic/Math.

The honest take

It's a three-line function wrapped in a node - and that's fine. Every loop toolbox needs a compare; EasyUse ships one, this pack ships its own to avoid depending on EasyUse. You won't reach for it every day, but the day you need "stop when the counter reaches 12" you'll be glad it's there. Just remember: the boolean only is information. ComfyUI has no native if/else, so a true output only matters if the node you feed it to actually branches on it. If your loop just ignores the boolean, this node bought you nothing - build the branch, then compare.

CategoryBoyo/Logic/Math

Inputs (3)

NameTypeDefaultDescription
a*0
b*0
comparisonCOMBOa == b6 options: a == b, a != b, a < b, a > b, a <= b, a >= b

Outputs (1)

NameTypeDescription
booleanBOOLEAN