Nodes/tri3d-comfyui-nodes/Recognise face v5.1.0
ComfyUI Node

Recognise face v5.1.0

Is that still the same person? A face-similarity gate for your workflow

By TRI3D-LC·Created 3 years ago·Updated about a year ago· 27
Recognise face v5.1.0
  • image1
  • image2
  • FLOAT

Recognise face takes two images and answers one question: are these the same person? It runs InsightFace's buffalo_l face detector on both, grabs the first face it finds in each, normalizes the two embeddings, and returns their cosine similarity as a single FLOAT. Same face usually scores well above 0.5; a different person lands somewhere well below. No API key, no network call at inference time, no threshold setting - it just hands you the number and lets you decide what to do with it.

This is a gate node, not a production face-recognition system. The natural use is conditional logic inside a bigger pipeline - the kind of thing this pack (a virtual try-on rig from TRI3D-LC) does a lot. If you're running a head-swap, a face-fidelity pass, or an identity-preservation check and you want to skip or rerun generations where the face drifted, you feed its FLOAT output into a compare node, set "same if > 0.6" or whatever your tolerance is, and let it branch your workflow. In an identity-preservation setup it's a cheap, local way to verify the subject didn't turn into somebody else between passes.

Inputs and output

Two inputs, both plain images:

  • image1 and image2 - the faces to compare. Both get squeezed and scaled to uint8 internally, so batch or single images both work.

One output, a FLOAT - the cosine similarity (the code labels it "overlap (float)"). Wire it into any threshold/compare node and use the boolean to gate a PreviewImage or an early-stop branch.

The install reality check

The pack installs normally - ComfyUI Manager (search "tri3d"), or:

cd ComfyUI/custom_nodes
git clone https://github.com/TRI3D-LC/tri3d-comfyui-nodes
# restart ComfyUI

Keep the folder named tri3d-comfyui-nodes; the pack's module path depends on it. The subtle bit: insightface is not in the pack's requirements.txt. The node imports it lazily at runtime, so the pack installs clean and then this node dies on first use with a ModuleNotFoundError. Fix it once:

pip install insightface

First run also downloads the buffalo_l model pack automatically (a few hundred MB, needs internet). After that it runs fully offline and is fast on CPU.

Gotchas

  • It assumes exactly one face per image - it reads face1[0] and face2[0]. No face detected means an index error, not a graceful low score. Crop tight before feeding it.
  • You get a similarity, not a judgment. The node never tells you "same or not," which is honestly fine for a utility, but it means your workflow carries the threshold, not the node.
  • The download-on-first-run pattern is the same throughout this pack (the AEMatter and cloth-seg nodes do it too), so if the network is blocked on your box, expect surprises when nodes first fire.

Worth reaching for? If you're hand-rolling identity checks in ComfyUI, yes - it's the shortest path to a face-distance float without dragging in a whole face-analysis custom node. Just budget the one-time insightface setup.

CategoryTRI3D

Inputs (2)

NameTypeDefaultDescription
image1IMAGE
image2IMAGE

Outputs (1)

NameTypeDescription
FLOATFLOAT