Nodes/ComfyUI-Image-Filters/Difference Checker
ComfyUI Node

Difference Checker

A proper abs-value diff for A/B-ing two images

By spacepxl·Created 3 years ago·Updated 8 months ago· 293
Difference Checker
  • images1
  • images2
  • IMAGE
multiplier1.00
print_MAEfalse

Comparing two images pixel-by-pixel sounds simple until you actually try to see the difference - subtle changes often show up as an almost-black image that hides exactly the information you were trying to see. Difference Checker exists to fix that: it computes the absolute value of the difference between two images (unlike ComfyUI's built-in merge-difference node, which is just subtraction and can go negative and clip), and gives you a multiplier to boost faint differences up to something you can actually look at.

Why absolute value matters here

Plain subtraction between two images can produce negative values, and negative pixel values either clip to black or wrap around depending on how they're handled downstream - either way, you lose information about how the images differ, not just whether they do. Taking the absolute value fixes that: every difference, positive or negative, shows up as a positive brightness, so what you see is a true magnitude-of-difference map, brighter where the two images diverge more.

Inputs and outputs that matter

  • images1 / images2 - the two images you're comparing.
  • multiplier (0.01-1000, default 1) - scales the difference up. Real differences between two similar generations are often tiny in absolute pixel value, so without boosting, a genuinely different region can look almost identical to a genuinely identical one. Push this up until the meaningful differences are actually visible.
  • print_MAE (boolean, default false) - also prints the Mean Absolute Error to the console: a single number summarizing how different the two images are overall, useful when you want a quantifiable comparison rather than just a visual one - checking whether a code change actually altered output, or how close two seeds/settings landed, for instance.

Output: a single IMAGE - the boosted difference map.

Installing it

ComfyUI Manager: search ComfyUI Image Filters, or clone directly:

cd ComfyUI/custom_nodes
git clone https://github.com/spacepxl/ComfyUI-Image-Filters

Restart afterward. No model weights, pure pixel arithmetic. The pack's opencv dependency remains the one thing worth watching on install - conflicts with other node packs' opencv versions cause import errors, fixed by the repo's import_error_install.bat, or manually by keeping only opencv-contrib-python.

Where people get burned

Leaving multiplier at 1 and concluding "these images are basically identical" is the most common misread - most real differences worth investigating are subtle enough that they need real boosting to be visible at all. If your diff map looks uniformly near-black, bump the multiplier before trusting that reading; don't assume flat-black output means no difference.

The two images need matching dimensions - this is a per-pixel operation, not a semantic comparison, so resize mismatches will error rather than produce a meaningful, if odd, result. And remember this is purely visual/numeric similarity: it'll flag a difference just as strongly for a one-pixel shift in position as for a genuine content change, so it's a tool for "did anything change and roughly how much," not for judging whether a change is good or bad.

CategoryImage-Filters/image

Inputs (4)

NameTypeDefaultDescription
images1IMAGE
images2IMAGE
multiplierFLOAT1.000.01–1000
print_MAEBOOLEANfalse

Outputs (1)

NameTypeDescription
IMAGEIMAGE