Nodes/MTB Nodes/Image Compare (mtb)
ComfyUI Node Runs on cloud

Image Compare (mtb)

A difference view for two images

By melMass·Created 3 years ago·Updated about a month ago· 721
Image Compare (mtb)
  • imageA
  • imageB
  • IMAGE
modecheckerboard

Two images go in, one comparison image comes out. This is the node you drop at the end of a graph when you want to actually see what changed between a before and an after - two samplers, two upscalers, an edit versus the original - instead of flicking between output tabs and trusting your memory.

It's worth being clear about what this is and isn't, because MTB and other packs have a couple of differently-named compare nodes. This one doesn't stitch a labeled side-by-side strip. It produces a single blended or differenced image, laying the two inputs on top of each other so the relationship between them is the picture. That makes it better for spotting subtle changes and worse for a clean presentation graphic. Pick accordingly.

How it works

No model, no download - pure image math. It takes both images and combines them per the mode you choose. Simple, instant, CPU.

The inputs that matter

  • imageA and imageB - the two images. Order matters a little depending on mode, but for a straight comparison it's symmetric enough not to fuss over.
  • mode - this is the whole node. Three choices:
    • checkerboard (default) - interleaves the two images in a checker pattern so alternating tiles come from A and B. Great for lining up edges and catching drift, misalignment, or a shift in framing.
    • diff - the literal pixel difference. Identical images come out black; wherever they differ, the difference lights up. This is the one for "did anything actually change, and where?" A near-black output means your two runs are basically the same.
    • blend - a straight overlay of the two, so you see both at once, ghosted together.

The single output is IMAGE - wire it to a Preview Image or Save Image. That's it.

How to install it

ComfyUI Manager: search MTB Nodes (comfy_mtb), install, restart. Or manually: cd ComfyUI/custom_nodes && git clone https://github.com/melMass/comfy_mtb and restart. Pure Python, nothing to fetch - if MTB loaded, this loaded.

Common issues

The main thing to get right is that both images should be the same dimensions. If A and B are different sizes, a per-pixel operation like diff doesn't have a clean answer, and you'll get an alignment that looks wrong or an error depending on your inputs. Resize one to match the other upstream before comparing - otherwise you're comparing framing, not content.

The other trap is over-reading diff. Any tiny change in seed, sampler, or even VAE rounding will make some pixels differ, so a completely black diff is rare and not the bar. What you're looking for is where the bright areas cluster: concentrated in one region means a localized edit landed; scattered evenly everywhere usually means you changed something global like the whole sampler or the model. Use checkerboard when you care about geometry lining up, and diff when you care about which region moved.

Categorymtb/image

Inputs (3)

NameTypeDefaultDescription
imageAIMAGE
imageBIMAGE
modeCOMBOcheckerboard3 options: checkerboard, diff, blend

Outputs (1)

NameTypeDescription
IMAGEIMAGE