CV SFace Embeddings
Turns each detected face into a 128-D identity vector (cv2.FaceRecognizerSF, the SFace model). This is the recognition half that 'CV YuNet Face Detect' does not do: YuNet answers WHERE a face is, SFace answers WHOSE it is. FaceRecognizerSF is a cv2 class the auto-generated wrappers cannot expose. Place face_recognition_sface_2021dec.onnx in ComfyUI/models/onnx. Wire YuNet's 'landmarks' output straight into 'landmarks' here - cv2 aligns each face onto a canonical 112x112 crop using ONLY those five points (eyes, nose, mouth corners), which is what makes the embedding pose-invariant. Compare the vectors with 'CV Embedding Match'. Data only: the aligned crops come out as an IMAGE batch so you can see exactly what the model read. Zero faces is a valid result (empty embeddings, count = 0).
- image
- landmarks
- embeddings
- aligned
- count
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | NPARRAY,IMAGE | Image the faces were detected in. An IMAGE batch uses its first frame. Accepts a ComfyUI IMAGE/MASK directly (frame 0 of a batch) or an NPARRAY. Arithmetic ops (add, multiply, etc.) process the full IMAGE batch when both inputs have the same batch size. | |
| model | COMBO | SFace .onnx model from ComfyUI/models/onnx (face_recognition_sface_2021dec.onnx). | |
| landmarks | NPARRAY | (N*5, 2) float32 landmarks, five per face in YuNet's order (right eye, left eye, nose, right/left mouth corner) - the 'landmarks' output of 'CV YuNet Face Detect'. The row count must be a multiple of 5. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| embeddings | NPARRAY | (N, 128) float32, one identity vector per face, in the same order as the landmarks. Feed 'CV Embedding Match'. Empty (0, 128) when there are no faces. |
| aligned | IMAGE | IMAGE batch of the aligned 112x112 crops the model actually read - preview it when a match looks wrong; a bad alignment is the usual cause. |
| count | INT | How many faces were embedded. |