Person Selector (Match)
'Is that them?' — a one-shot ArcFace matcher
- current_image
- reference_images
- sam_model
- similarity
- match
- mask
- best_reference
- face_count
- matched_face_index
- report
The simplest question in face-consistency work is "is that them?", and Person Selector answers it with a number. It takes your current image, compares every detected face against one or more reference images using InsightFace ArcFace embeddings, and hands you the best similarity score, a boolean match, and an optional mask. It's the single-reference little sibling of Person Selector Multi - same ArcFace backbone, none of the multi-person machinery.
Where you'd actually use it: as a gate. Wire match into a switch so a detailer or a save node only runs when your character is actually in frame, or log the similarity to decide whether a generation is worth keeping. If you're holding one consistent character across a batch of renders, this is often all you need - Multi is for when you've got two or more people competing for attention.
How it works
InsightFace detects and aligns faces, then produces ArcFace embedding vectors - biometric identity, not appearance. The node compares the current image's faces against the reference embeddings. aggregation decides how to combine scores when you feed multiple reference images of the same person: max, mean, or min. threshold is the cosine-similarity cutoff, and 0.6–0.7 is the recommended band - too low and every face "matches", too high and your character stops matching their own slightly-off renders.
mask_mode picks the segmentation: face and head masks come from BiSeNet parsing (the pack's 53MB parsing_bisenet.pth), while body needs a SAM model connected to the optional sam_model input - from Impact Pack's SAMLoader. Set none if you only want the score, and the node skips segmentation entirely.
The inputs that matter
current_imageandreference_images- the two images.threshold- the match cutoff (0.6–0.7).mask_mode-none/face/head/body.det_size- higher finds smaller faces but uses more VRAM.
Outputs
similarity, match, mask, best_reference (the reference that matched best), face_count, matched_face_index, and a report string. The first two are what you wire into logic.
Install
Face tools pull in the pack's real dependencies:
cd ComfyUI/custom_nodes
git clone https://github.com/ping1979ping/comfyui-FVMtools
pip install insightface>=0.7.3 onnxruntime-gpu>=1.17.0 opencv-python>=4.8.0 numpy>=1.24.0
Restart. InsightFace's buffalo_l models auto-download on first use (~342MB into models/insightface/models/buffalo_l); parsing_bisenet.pth is a manual ~53MB download into models/gfpgan/.
Common issues
Install errors are the #1 wall - onnxruntime-gpu wants a CUDA-matching version, and CPU-only users should install plain onnxruntime instead. If the node errors on model download, grab the buffalo_l files from HuggingFace and drop them in manually. Body masks silently missing = SAM isn't connected. And remember InsightFace's pretrained ONNX models carry non-commercial license restrictions - fine for hobby use, a real consideration if anything here touches commercial work.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| current_image | IMAGE | — | |
| reference_images | IMAGE | — | |
| threshold | FLOAT | 0.650–1 | Minimum cosine similarity to count as match (0.6-0.7 recommended) |
| aggregation | COMBO | How to combine similarity scores across multiple reference images | |
| mask_mode | COMBO | none=no mask, face=skin only, head=face+hair, body=full body (needs SAM) | |
| mask_fill_holes | BOOLEAN | true | Fill holes inside the mask (closes gaps in segmentation) |
| mask_blur | INT | 00–100 | Gaussian blur radius for mask edges |
| det_size | COMBO | Face detection resolution — higher finds smaller faces but uses more VRAM | |
| sam_modelopt | SAM_MODEL | (opt) SAM model from Impact Pack SAMLoader — required for body mask mode |
Outputs (7)
| Name | Type | Description |
|---|---|---|
| similarity | FLOAT | — |
| match | BOOLEAN | — |
| mask | MASK | — |
| best_reference | IMAGE | — |
| face_count | INT | — |
| matched_face_index | INT | — |
| report | STRING | — |