ComfyUI Node

PVL Compare

The two-second comparison node that unblocks whole workflow branches

By pvlprk·Created about a year ago·Updated 8 months ago· 1
PVL Compare
  • a
  • b
  • boolean
comparisona == b

PVL Compare is the kind of node you don't think about until you need it, and then it's the thing that makes a whole workflow branch actually possible. It takes any two values, compares them with one of six operators, and hands you a true/false. That boolean is the switch that gates the rest of your graph - which sampler runs, which prompt gets used, whether you save the image at all. In a node graph, that's the difference between "I have to babysit this" and "the workflow decides for itself."

It ships inside the ComfyUI Assistant Node pack from pvlprk, which despite the "Assistant" name is really a grab-bag of dozens of nodes: fal.ai cloud generation, Gemini calls, and a pile of local utilities like this one. If you already have the pack installed for the API nodes, this is free. If not, install the pack (below) and you get the whole toolkit.

How it works

Dead simple under the hood, which is the point. It feeds inputs a and b into a Python comparison from a menu of six: a == b, a != b, a > b, a < b, a >= b, a <= b. The output is a single boolean you wire wherever you'd feed a condition.

The trick that makes it genuinely useful is the input types. Both a and b are * (any type), so they'll accept a number, a string, even a tensor. That's what lets you do things like compare the height of two images, check whether a seed is non-negative, or test if a prompt string is empty - and then route the result into a switch node. If a comparison throws (say you compare a string to a number), it just returns false instead of killing the queue, which is forgiving but worth knowing: a false might mean "comparison failed," not "comparison is false."

The inputs that matter

  • a and b - the two values to compare. Both default to 0 and accept anything.
  • comparison - the operator, default a == b. The menu is the six you'd expect.

One output: boolean.

Installing it

The node is part of pvlprk/comfyui-pvl-api-nodes. Easiest path is ComfyUI Manager - search for the pack title "ComfyUI Assistant Node" and install. Or clone it by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/pvlprk/comfyui-pvl-api-nodes

Then restart ComfyUI. The pack's requirements.txt pulls in a fairly heavy list (torch, diffusers, Pillow, scikit-image and friends) even though this one node needs almost none of it - that's a one-time cost of the pack, not of PVL Compare.

Where people get burned

The main trap is expecting == to be safe on float values that come out of a node's math. Two computed floats that "should" be equal often aren't, down in the last decimal. If you're comparing sizes or values that went through rounding, use >=/<= or compare against a tolerance you build yourself - otherwise you'll chase a false that's technically correct. Other than that, there's not much to break. It's a utility node, and it does exactly one job well.

CategoryPVL/Logic

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