Nodes/ComfyUI-Artha-Nodes/πŸ”± Artha Logic Compare
ComfyUI Node

πŸ”± Artha Logic Compare

Turn 'is A bigger than B?' into a Boolean the graph can act on

By CyrostarΒ·Created 10 months agoΒ·Updated 8 months agoΒ· 0
πŸ”± Artha Logic Compare
  • a
  • b
  • state
β—„op==β–Ί

Artha Logic Compare is the πŸ”± Artha pack's decision-maker: it takes two values, compares them with a selected operator, and outputs true or false. It's the node that turns "is this width β‰₯ 1024?" or "are these two strings the same?" into a Boolean a conditional branch can actually act on.

This is the quiet workhorse of the pack's Logic family. While Basic gives you a constant and Gate combines Booleans, Compare is where real-world conditions get computed - the "if the image came out bigger than expected, route it to a different upscaler" style of logic that makes a workflow adaptive instead of fixed.

How it works

The op dropdown offers the six classic comparison operators: ==, !=, >, <, >=, <=. The two inputs, a and b, are both any-type (*), so they can be numbers, strings, or anything else - Python's comparison semantics apply. Output is a single state BOOLEAN, the result of the comparison.

The any-type inputs are the thing to keep in mind. Comparing two ints or two strings works exactly as you'd expect. Comparing an int to a string, or an image to anything, will throw or return nonsense - this node is for scalar values, not tensors.

Inputs that matter

  • op - the comparison operator, defaults to ==.
  • a / b - the two values to compare. Both required, both any-type.

Output: state (BOOLEAN), ready to feed a gate, a passthru, or any Boolean branch.

Installing it

One-pack install, same as the whole Artha family:

cd ComfyUI/custom_nodes
git clone https://github.com/Cyrostar/ComfyUI-Artha-Nodes
pip install -r ComfyUI/custom_nodes/ComfyUI-Artha-Nodes/requirements.txt

restart ComfyUI, or install "ComfyUI-Artha-Nodes" through ComfyUI Manager. No API key, no models, no extra deps - it's a Python comparison wrapper.

Common issues

  • a > b errors on strings: > and < aren't defined between arbitrary types in Python. Only use ordering operators on numbers (or ordered types); use ==/!= for strings.
  • Comparing a tensor to a number: doesn't do what you want. This node is for scalars - wire the width output of a transform node, not the image itself.
  • Unexpected equality results: == compares types too. 1 and 1.0 are equal in Python, but "1" and 1 are not. Cast to matching types first.

Where it earns its keep: size thresholds on generated outputs, seed comparisons, string matching between text nodes - all the "should I take this branch?" questions that make a workflow feel less like a fixed recipe and more like a program.

CategoryArtha/Logic

Inputs (3)

NameTypeDefaultDescription
opCOMBO==6 options: ==, !=, >, <, >=, <=
a*β€”
b*β€”

Outputs (1)

NameTypeDescription
stateBOOLEANβ€”