Edge Match Checker
Edge Match Checker compares masks, not edges — and it's a tidy QA gate
- image_a
- image_b
- result
The verdict, first
EdgeMatchChecker takes two images - or, much more usefully, two alpha masks - and answers exactly one question: do these match, yes or no? It returns a single string, "Yes" or "No", based on how much of the white area of one overlaps the white area of the other, with two sliders so you decide how strict "match" means.
The use case that makes it worth having: you ran an image through an editing model - an inpaint, a face fix, a background swap - and you need to know, automatically, that the subject didn't drift or change proportions. It's validation. A QA step. The kind of check you want when you're churning through a batch in production, not hand-eyeballing one image.
The name is a lie (mostly)
First, there's no edge detection anywhere in this node. No Canny, no Sobel, no line art. What it actually does, reading the source: converts both inputs to grayscale, thresholds everything brighter than 20 to pure white (so near-black goes to 0), and measures how much white overlaps between the two masks. "Edges" here just means "the white pixels of a binarized mask."
That tells you how to feed it. The author's own suggestion is the right one: run your image through a background-removal node - they name RMBG, and these days BiRefNet is the one most people reach for - grab the alpha mask, and compare masks rather than raw photos. Feed it two arbitrary full-color photos and the "bright pixels" interpretation gets noisy fast: two dark images with different textures will score as a match, and a photo versus its own subject crop will behave in ways that make no sense. Masks in, not photos.
The two settings that matter
min_overlap_percent(default 90): the pass threshold. The README suggests 95 for production - and the code defaults to 90, so the docs and the code disagree. Bump it if you want stricter.tolerance_pixels(default 2, range 0–10): the slop allowance. The mechanism is dilation - each mask gets fattened by that many pixels before the overlap is measured, so a one- or two-pixel shift in the subject won't count against you.
Under the hood it also resizes the smaller input up to the larger one (nearest-neighbor) so mismatched dimensions don't crash it, then computes overlap as intersection / the larger mask. That denominator matters: since it's the bigger of the two, a mask that sits entirely inside the other can still pass. This node measures "does the big one cover the little one" at least as much as it measures true equality. Fine for drift-checking; don't read it as an exact-match metric.
Wiring it up
The output is a string, and this is where the README oversells a little. It says you can hook the result to "Boolean logic," but the output isn't a boolean, so you can't feed it straight into most switch/if nodes. Plan to convert that "Yes"/"No" into a real boolean (a string-to-boolean node from whatever utility pack you already run), or just hang a Show Text node on it to watch the verdict while you tune the workflow. Also worth knowing: it only looks at the first frame of each input batch, so this is a single-image check, not a per-frame video one.
Installing
One of the easy ones. ComfyUI Manager → search "edge-match-checker," or:
cd ComfyUI/custom_nodes
git clone https://github.com/comrender/ComfyUI-edge-match-checker
then restart. No model downloads, no GPU requirements, nothing heavy - the only real dependency is OpenCV (cv2), which ComfyUI already ships. It's a two-file pack with a single node in it. What you see is all there is.
Bottom line
Thin, but honest about being thin. You'd reach for this when you're automating a pipeline and need a cheap yes/no gate between steps - not when you're hand-tuning a single image. Dependency-free, no install fuss, does one job. Just remember the golden rule: masks in, not photos.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image_a | IMAGE | — | |
| image_b | IMAGE | — | |
| tolerance_pixels | INT | 20–10 | — |
| min_overlap_percent | FLOAT | 90.050–100 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| result | STRING | — |