Face Comparator
Are those two faces the same person? This tiny node just tells you.
- image1
- image2
- text
- is_same_person
FaceComparator answers one question and refuses to do anything else: is the person in image A the same person as in image B? It's the smallest node in the pack, and honestly it's the one you reach for after you've built the actual face tools. Think of it as the QA step your identity workflows are missing.
Where it earns its keep: you've generated twenty variants with InstantID, FaceID, or PuLID and you want to know which ones actually hold the subject's face instead of drifting into a convincing stranger. Or you've just run a face swap and you want an objective "did it keep the identity?" check instead of squinting at two images side by side. Wire it up after the generation, feed it the reference and the output, and let the boolean decide.
How it works
Under the hood it's InsightFace doing everything, and InsightFace is the same backbone behind FaceID, InstantID, PuLID, ReActor, and Roop - the monoculture that the whole identity corner of the ecosystem runs on. It detects a face in each image, aligns it, and turns it into an ArcFace embedding: a vector encoding facial geometry, not appearance. Then it compares the two vectors with cosine similarity, which is a one-line np.dot because the embeddings come pre-normalized. Score above the threshold means same person, below means not.
Two things the source tells you that the README doesn't. First, it only looks at the first detected face in each image - feed it a group shot and it silently compares one arbitrary face per image. Second, if it finds no face at all it doesn't throw; it returns the text Error: No faces detected in image 1. plus a False boolean, so your downstream logic will treat a missing face as "not the same person." That's a trap worth knowing when you're gating on the output.
The inputs and outputs
Only three inputs, and only one of them matters:
- image1 / image2 - any IMAGE. The node runs on CPU regardless of your GPU setup, so this is cheap; no VRAM pressure.
- similarity_threshold - float, default 0.65, range 0–1. The verdict flips on this. Higher means stricter: raise it to ~0.75 if you're getting false "same person" matches, drop it toward 0.5 if the generator's face is close but not exact.
Outputs are a text string (a human-readable verdict with the actual similarity score) and is_same_person (a boolean). The boolean is the useful one - pipe it into a switch or a conditional node to auto-route "matched" images to a save/upscale branch and "mismatched" ones to a regenerate branch.
Installing it
ComfyUI Manager: search "ComfyUI-Face-Comparator" and install. Or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/fr0nky0ng/ComfyUI-Face-Comparator.git
cd ComfyUI-Face-Comparator
pip install -r requirements.txt
The requirements.txt pins insightface==0.7.3 plus opencv-python and onnxruntime. On first run it auto-downloads the buffalo_l model pack (about 326MB) into ~/.insightface/models/, so the very first execution needs internet. It only ever runs on CPU, so no CUDA setup is involved - which is the one thing this node has going for it in the install department, because InsightFace is otherwise notorious as the worst install in local generation.
Troubleshooting
insightfacefails to install. That pinned 0.7.3 is the pre-1.0-era release that spent three years without PyPI updates; on newer Python versions pip falls back to compiling from source, which on Windows means Visual Studio build tools. If that's happening, install the current InsightFace 1.x instead - theFaceAnalysisAPI this node calls hasn't changed, and 1.0 dropped the C++ build requirement entirely.- "No faces detected" - the image is too small, too occluded, or the face is tiny (detection runs at 640x640). Crop in on the face first.
- Everything says "not the same person" - 0.65 is tuned for real photos, not generations. Generations that resemble a person but aren't them often score lower; lower the threshold if that's what you're testing.
One honest caveat before you build a product on this: the buffalo_l weights InsightFace downloads are non-commercial. Fine for personal QC; not fine for a paid service.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image1 | IMAGE | — | |
| image2 | IMAGE | — | |
| similarity_threshold | FLOAT | 0.650–1 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |
| is_same_person | BOOLEAN | — |