Face Matcher
Pick the right threshold before you extract 10,000 frames
- image_a
- image_b
- similarity
- match_info
The single thing that makes or breaks the Face Extractor node is similarity_threshold. Guess it and you either miss half the shots of your target or collect everyone who vaguely resembles them from across a two-hour video. FaceMatcher exists so you don't guess - it's the calibration tool for the whole pack.
It's deliberately tiny: feed it two face images, and it tells you how similar they are on a 0–1 scale. That's it. You use it like this: grab a couple of good shots of your target person and compare them against each other (that gives you the same-person score range), then compare one of those against a photo of someone who looks similar but isn't them (that's the different-person range). Your extraction threshold belongs somewhere between the two. It's a ten-minute sanity check that saves you from kicking off a huge extraction with garbage settings, and the pack ships a ready-made 03_threshold_tuning.json workflow for exactly this.
How it works
Both input images go through the same detection backend the rest of the pack uses. It takes the first face detected in each image, computes its embedding, and returns the cosine similarity between the two. So no, it's not a fancy ensemble - it's the pack's own matching math, exposed so you can watch it work before you trust it at scale. If no face is found in one of the images, you get 0.0 and a match_info string explaining that detection failed, rather than a misleading "not the same person."
Its two outputs are similarity (FLOAT) and match_info (STRING - which backend ran, and what it found). It's not an output node, so wire them into a ShowText/DisplayAny node to actually read them.
What the numbers mean
The README's threshold guide is worth taking literally, because the scale shifts with the backend:
| Backend | Same person | Different person | Suggested threshold | |---|---|---|---| | facenet / yolov8+w/FaceNet / insightface | 0.65–0.85 | 0.20–0.40 | 0.55–0.65 | | mediapipe (histogram embeddings) | 0.70–0.90 | 0.40–0.60 | 0.65–0.75 | | opencv_cascade (histogram embeddings) | 0.75–0.95 | 0.50–0.70 | 0.70–0.80 |
The pattern: neural backends give clean separation between same and different person, so a mid-range threshold works. The histogram-based backends (MediaPipe, OpenCV cascade) cluster everything higher, so they need a more aggressive cutoff. If you switch backends between your calibration run and the real extraction, re-run the test - the numbers don't carry over.
Install
Same pack as the extractor - FaceMatcher ships with llikethat/ComfyUI-faceExtractor. Via ComfyUI Manager, search "faceExtractor"; or:
cd ComfyUI/custom_nodes
git clone https://github.com/llikethat/ComfyUI-faceExtractor
cd ComfyUI-faceExtractor
pip install facenet-pytorch mediapipe psutil
Restart ComfyUI and it appears under the "Face Extractor" category. The detection_backend dropdown only lists backends you actually have installed.
Gotchas
- Multiple faces in one image - it silently uses the first one detected. If your input is a group shot, crop to the single face you care about first, or the score is meaningless.
- Wrong backend - this node only embeds a single face pair, so it's quick, but the score is only meaningful if the backend matches your extraction run (see the threshold table above).
- The score is a comparison, not a verdict - a 0.62 with FaceNet might be your person; the same 0.62 with MediaPipe could be a miss. That's why you calibrate on your own images instead of trusting one absolute number.
It's a small node, but it's the difference between a clean dataset and hours of manually deleting wrong crops afterward. Tune first, extract second.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image_a | IMAGE | — | |
| image_b | IMAGE | — | |
| detection_backendopt | COMBO | facenet | 5 options: facenet, yolov8, insightface, mediapipe, opencv_cascade |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| similarity | FLOAT | — |
| match_info | STRING | — |