Nodes/🐰 MaraScott Nodes/🐰 Is Equal ? - v1 /c
ComfyUI Node

🐰 Is Equal ? - v1 /c

Compare any two values and get a BOOLEAN

By MaraScottΒ·Created 3 years agoΒ·Updated 10 months agoΒ· 179
🐰 Is Equal ? - v1 /c
  • any_1
  • any_2
  • boolean

Conditional workflows in ComfyUI are awkward because core gives you almost no comparison primitives. Is Equal ? is one of the few: it takes two values of any type, checks whether they're equal, and emits a BOOLEAN you can feed into a switch or a loop condition. It's the "if these two things match, do something different" node, and it's shockingly useful once you start building logic into your graphs.

Equal strings, equal integers, equal seeds - those are the obvious uses. But because the inputs are * (any type), it also compares the two inputs with Python's equality semantics, which is more capable than you'd expect.

How it works

It returns True when any_1 == any_2, False otherwise, using plain Python equality. That means:

  • Two INTs or two STRINGs compare the obvious way.
  • A None compared to a None is True - useful for "is this still unset?" checks alongside the pack's Is None ?.
  • A False compared to 0 is True (Python considers them equal) - a gotcha if you're comparing booleans against numbers and expect strictness.

Inputs: any_1, any_2 (both *). Output: boolean (BOOLEAN).

Using it

The classic pattern: compare a seed or a mode selector against a target value, wire the boolean into a Switch node, and route the workflow down two different paths. Pair it with For Loop ToBoolNode or a while-loop condition for "loop until X equals Y" logic - combined with the pack's IntMathOperation, you can count up and stop at a target, which is a genuinely clean way to express "do this exactly K times" when the iteration count depends on runtime state.

Installing it

Ships in the MaraScott pack: ComfyUI Manager β†’ search "MaraScott" β†’ Install β†’ restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/MaraScott/ComfyUI_MaraScott_Nodes

Then restart. Standard pack caveats apply: heavy requirements for a comparison node (transformers==4.37.2 pinned, opencv-python, numba, blend_modes).

Common issues

Two Python quirks bite people. First, type looseness: True == 1 and False == 0 are both true, so comparing a boolean to a number won't behave strictly - if you need strict type equality, normalize the types first. Second, comparing tensors with == doesn't produce a simple bool; a multi-element tensor can throw or behave oddly, so don't feed raw IMAGE/MASK tensors into this expecting a clean answer - compare scalar values (seeds, counts, strings) and you're fine. And None inputs: None == None is true, which is sometimes exactly what you want and sometimes a surprise.

Category🐰 MaraScott/Utils

Inputs (2)

NameTypeDefaultDescription
any_1*β€”
any_2*β€”

Outputs (1)

NameTypeDescription
booleanBOOLEANβ€”