Gender Recognition
The sensor at the start of CHAOS' prompt pipeline
- input_image
- gender
- gender_int
This is the simplest node in the CHAOS pack, and apparently the one people actually find: it's the single input, the "Gender Recognition" node, which is nothing but a classifier with an attitude. You feed it an image, it tells you whether the person in it reads as male or female, and it hands you both a human-readable string and an integer you can wire into something else. That integer is the whole point, because this node exists to be the sensor for the pack's larger trick: automatically picking the right preset prompt for whatever you just generated.
What it's for
In the wider ComfyUI world, face work splits into two camps. There's the identity crowd - IP-Adapter FaceID, InstantID, all the InsightFace-embedding tools that hold a likeness across generations. Then there's the composition crowd, which this pack belongs to: laying a face onto a properly framed canvas so your portrait, half-body, and full-body shots come out with sensible head sizes and eye lines. Gender Recognition is the decision point between them. It answers one question - "who am I composing here?" - so the Prompt Selector nodes downstream can pick a matching template without you touching a widget. Feed its int output into the mode_code of a PromptSelector and the workflow decides for itself.
How it works
Under the hood it's InsightFace, the same library every FaceID/InstantID/ReActor pipeline runs on. The node lazily loads a FaceAnalysis session on first execution, scans the image, and takes the largest detected face - which is why the README warns it's built for single-person shots. It reads that face's gender attribute and maps it:
gender(STRING):"Male","Female", or"Unknown"gender_int(INT):1for male,0for female,-1when it can't tell
The -1 matters, because it's the graceful-failure path. If InsightFace isn't installed, the weights aren't downloaded, or no face is found, the node returns ("Unknown", -1) instead of crashing the graph. Annoying if you wanted an answer, but a lot better than a bricked workflow.
The one input that matters
input_image (IMAGE) is the only input. No sliders, no mode enums, no fine print. You can wire in a load image, a KSampler's preview, or a Face AutoFit output and it'll do its thing.
Installing it
The pack installs as a whole - all eight CHAOS nodes arrive in one go. Easiest route is ComfyUI Manager: search ComfyUI_FaceAlignPaste, install, restart. Or clone it:
cd ComfyUI/custom_nodes
git clone https://github.com/CHAOSEA/ComfyUI_FaceAlignPaste
The dependencies are the heavier story: insightface, dlib, mediapipe, and opencv-python all land in your Python environment. InsightFace's buffalo_l model auto-downloads on the first detection run to ComfyUI/models/insightface/models - the same spot IP-Adapter plus uses, so if you already run FaceID you probably already have it. dlib compiles from source, which on Windows means CMake plus MSVC build tools and a wait. And note the licensing wrinkle: InsightFace's weights are non-commercial, so this is a hobby-workflow node, not the foundation for a product.
Gotchas
- Single-person only. Feed it a group photo and you get the verdict on whoever's face is biggest, with no way to aim it at anyone else.
- First run is slow. The model download plus load can stall the graph for a minute. It's cached after that.
- Don't trust it blindly on ambiguous subjects. InsightFace's gender attribute is a coarse binary and it's wrong often enough that you'd want the
-1-safe path wired anyway.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| input_image | IMAGE | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| gender | STRING | — |
| gender_int | INT | — |