Nodes/comfyui-easyapi-nodes/Image Equal Judgment
ComfyUI Node

Image Equal Judgment

ImageEqual (Image Equal Judgment) – ComfyUI Node

By lldacing·Created 3 years ago·Updated 8 months ago· 96
Image Equal Judgment
  • a
  • b
  • is_b

What it is

ImageEqual (labeled "Image Equal Judgment" in the node menu) does a pixel-level equality check between two images and returns a plain true/false. That sounds almost too simple to need a dedicated node, but the README calls out the actual reason it exists: you can use it to detect whether a mask is genuinely empty by comparing it against a solid black image of the same size. If they're pixel-equal, the mask has nothing in it - nobody painted anything, no region was detected, whatever process was supposed to produce a mask produced nothing. That's a surprisingly common thing to need to branch on: skip an inpainting pass entirely if there's no mask to work with, rather than running an expensive sampling step on a mask that does nothing.

How it works

Straight pixel comparison between a and b. If every pixel matches, is_b comes back true; any difference at all, false. There's no tolerance or fuzziness built in as far as the schema shows - this reads as an exact match, not a "close enough" similarity check, so don't reach for it expecting perceptual comparison (two visually near-identical images with even minor compression or resampling differences would likely register as unequal).

Inputs and outputs

Two required inputs: a and b, both IMAGE. One output: is_b (BOOLEAN) - true if the two images are equal.

Installing it

Bundled inside comfyui-easyapi-nodes. ComfyUI Manager: search "comfyui-easyapi-nodes", install, restart. Manual route:

cd ComfyUI/custom_nodes
git clone https://github.com/lldacing/comfyui-easyapi-nodes.git
cd comfyui-easyapi-nodes
pip install -r requirements.txt

No special dependency for this node itself, but run the requirements install so the rest of the pack works too. git pull in the folder later to upgrade.

Common issues

"I'm trying to check if two generations are 'basically the same' and this always says false." That's expected if there's any variation at all - different seed, slightly different sampler settings, even lossy compression on one of the two. This node checks for exact pixel equality, not visual similarity. It's built for a narrower job (is this mask literally blank?) than general image-similarity comparison.

"How do I actually use this for the mask-emptiness check the README mentions?" Generate or load a solid black image at the same dimensions as your mask (converted to an IMAGE if it's currently a MASK - ComfyUI's mask and image types aren't interchangeable without a conversion step), feed that as one input and your mask-as-image as the other, and branch on is_b. If it's true, there's nothing in the mask and you can skip whatever masked operation was going to run.

"Both images look identical to my eye but this says they're not equal." Check that they're actually the same dimensions and the same underlying data - resizing, format conversion (even a lossless one that changes bit depth or color space), or passing one image through an extra node that subtly reprocesses it can all produce a pixel-level difference invisible to a casual look but very visible to an exact comparison.

CategoryEasyApi/Image

Inputs (2)

NameTypeDefaultDescription
aIMAGE
bIMAGE

Outputs (1)

NameTypeDescription
is_bBOOLEAN