Face-analyze
Age and gender from your render, minus the heavy install
- face_image
- gender
- age
You want to know the guessed age and gender of the face in an image you just generated, without installing another hundred-megabyte model to do it. That's this node. You feed it one image, it hands back two strings - gender and age - and the actual analysis happens on someone else's server.
There's a catch you should know before you wire it in, and it's a big one: this node does nothing locally. It serializes your image to PNG and POSTs it to the Face++ cloud API. No GPU, no VRAM, no model download - just a network call and an API key hardcoded in the source that every user of this pack shares. More on that below.
What it actually does
Read faceSimilarity.py and the node is a thin wrapper around the Face++ face detect endpoint - maybe twenty lines of real logic. It converts the incoming IMAGE tensor back to a PNG, uploads it to api-cn.faceplusplus.com/facepp/v3/detect with return_attributes: gender,age, and reads the answer out of the JSON response. Face++ - Megvii's face-recognition cloud - runs the actual detection and attribute classification. It's not a diffusion tool at all; the same service backs a lot of consumer face filters.
Two details matter in practice. First, if faces are found, the node only reports on faces[0], the first one detected - a group photo gives you one person's stats, not a survey. Second, if no face is found or the call fails, you get N/A for both outputs instead of a thrown error, which is nicer than a crash but easy to mistake for a real result.
The input and outputs that matter
One input, two outputs. That's the entire surface area:
face_image(IMAGE) - the image to analyze. Feed it from a Load Image or straight off a VAE Decode.gender(STRING) -MaleorFemale, per Face++'s classifier.age(STRING) - a number, but as text. Don't let that surprise you mid-workflow.
Both outputs are plain text. To actually see them, wire them into a text display node like Show Text - the node prints its result to the ComfyUI console, but nothing pops up on the canvas by default. And because age comes back as a string, you can't feed it straight into math or logic nodes without converting it first.
Installing it
It's a tiny pack with no model files, so install is quick:
- ComfyUI Manager: search "FaceSimilarity", install, restart.
- Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/ultimatech-cn/FaceSimilarity
pip install -r requirements.txt # just opencv-python
Then restart ComfyUI. The only entry in requirements.txt is opencv-python, which the module imports at load even though the node never actually calls it - skip that install and the node won't even appear in your list, so don't skip it.
There's no api_key widget. The key and secret are baked into faceSimilarity.py. The README's advice is to edit the file and drop in your own Face++ key; the author also hands out a free key (about 200 uses) if you reach out via the WeChat公众号 and message "Face++". You can guess how fast one shared key with a 200-use budget burns if more than a handful of people run this.
The catches
- Privacy. Your face images leave your machine and land in a Chinese cloud API - the
api-cnendpoint is hardcoded. For generated characters that's usually fine. For real people, read Face++'s terms first, and probably don't. - It's a network call. No internet, no result - you get
N/A/N/Aand a stack trace in the console. Firewalled or region-blocked networks fail silently here. - Shared key means rate limits. If calls start failing with API errors, that's likely the shared key being throttled, not your setup.
- First face only, strings out. Not a "score every face in the photo" tool.
If you want this locally, the ecosystem-standard answer is InsightFace - the same backbone under FaceID, InstantID, PuLID and friends. Heavier to install, but nothing leaves your machine. If you're already running one of those packs you probably don't need this node at all. If you just want a quick cloud answer for a character you generated, this gets it done in about a minute of setup.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| face_image | IMAGE | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| gender | STRING | — |
| age | STRING | — |