Age Checker
The Age Checker Node Will Flag a Face — Don't Treat It Like a Safety Guarantee
- image
- Predicted Age
- Confidence
- Is Underage
- Message
So you're running a ComfyUI pipeline that has to know whether the face it just generated belongs to an adult, and you found a node called "Age Checker." Good instinct to look - but read the confidence score before you wire this thing into anything with real stakes.
Age Checker is the flagship node of the Underage Filter pack (T-Ph525/ComfyUI-Underage-Filter). It runs a real vision transformer on your image, tells you what age bucket it thinks it sees, and flags it if that bucket falls under your threshold. The entire pack is built around one job: decide if a generated face is underage and let you stop the workflow if it is. Where people usually drop this in is right after the VAE decode - the last place you still have a clean image tensor - and use the verdict to gate what gets saved or shown. If that sounds like an NSFW-adjacent use case, it is, and it's also the legit one for things like validating character-consistency batches for a game studio that absolutely cannot ship a teenager in an adult context.
How it works
Under the hood there's no API and no magic: it's nateraw/vit-age-classifier from Hugging Face, a google/vit-base-patch16-224 model fine-tuned to classify a face into age buckets - 0-2, 3-9, 10-19, 20-29, and so on. The model loads locally on first use (a few hundred MB download), the image gets preprocessed into patches, and out comes a predicted bucket plus a softmax probability. Note the word bucket: this thing does not return a precise age like "27." It returns a range, and that coarseness matters for everything downstream.
Inputs and outputs that matter
The one input you'll actually touch is threshold_age (default 18, but you can drag it 0–100) - that's the line between "OK" and "underage." show_on_node toggles whether the verdict renders right on the node so you can eyeball it mid-run. use_local_model and local_model_path let you point at a copy of the model you already have on disk (default path /comfy/models/age-classifier) instead of re-downloading it. image is, of course, your IMAGE tensor.
Four outputs come out:
- Predicted Age - the bucket label, like
10-19. This is a string, and it's a range, not a number. - Confidence - the model's probability in that bucket, 0 to 1.
- Is Underage - a boolean, the verdict against your
threshold_age. - Message - a human-readable string you can pipe into a text display or log node.
Because this is an output-capable node, it'll happily sit at the end of a graph as a reporting node. When you want it to block, you wire the verdict into the pack's blocking logic - the same repo ships UnderageFilterNode and a generic MultiTypeGateNode that raises a PermissionError to halt the run.
Installing it
ComfyUI Manager is the path of least resistance: search "Underage Filter" and hit install, and Manager sorts the pip deps. Or do it by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/T-Ph525/ComfyUI-Underage-Filter
Then restart ComfyUI. The pack pins transformers==4.37.2 and pillow==10.2.0; torch and torchvision come from ComfyUI's own environment, so no separate CUDA install for this one. Your first run downloads the model from Hugging Face, so make sure you're not offline or behind a blocklist.
Where people get burned
- It underestimates adults. This is the big one, and it's not this pack's fault - it's the underlying model. There's a well-known r/comfyui thread (from someone building exactly this: age-gating in ComfyUI) where people report the classifier calling 30+ year-olds "3-5" years old, especially on stylized, portrait-cropped, or slightly blurry images. The buckets
3-9and10-19are exactly where a false "underage" lands, so a default 18 threshold will flag adult renders. Don't use this as a hard safety gate - treatConfidenceas your friend and set a high bar before acting onIs Underage. - CUDA or nothing. The pack hardcodes
.to("cuda")when it loads the model. On a CPU-only or Mac install you'll get a CUDA error, not a graceful fallback. - The pinned transformers version.
transformers==4.37.2is specific, and ComfyUI's no-isolation custom-node environment means another node wanting a newer transformers can silently override it (or vice versa). It's a known ecosystem pain, not a bug in this node. - The bucket is a range. Treating
10-19as "definitely underage" ignores that a 19-year-old adult lives in that bucket too.
Short version: Age Checker is a genuinely handy reporting node for a "should probably double-check this" signal, and genuinely unsuitable as an unexamined enforcement tool. Wire it in, watch the confidence, and keep a human (or a stricter second pass) in the loop.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| threshold_age | INT | 180–100 | — |
| show_on_node | BOOLEAN | false | — |
| use_local_model | BOOLEAN | false | — |
| local_model_path | STRING | /comfy/models/age-classifier | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| Predicted Age | STRING | — |
| Confidence | FLOAT | — |
| Is Underage | BOOLEAN | — |
| Message | STRING | — |