Nodes/ComfyUI-MiVolo-V2/MiVOLO Predictor (with Detector)
ComfyUI Node

MiVOLO Predictor (with Detector)

The all-in-one node — drop in an image, get age and gender per person

By vdeng-ai·Created 10 months ago·Updated 20 days ago· 26
MiVOLO Predictor (with Detector)
  • mivolo_model
  • detector_model
  • image
  • prediction_text
  • age
  • gender
mode
output_selection
conf_threshold0.40
iou_threshold0.70

This is the node the pack is really about. MiVOLO Predictor (with Detector), class MiVOLOAgeGenderPredictorWithDetector, does the whole pipeline in one place: a YOLO detector finds the people and faces, MiVOLO predicts age and gender for each, and you get clean string outputs on the other side. If you only wire up one node from this pack, it's this one.

How it works, end to end

Feed it a full image and it runs four steps internally:

  1. The YOLO detector (yolov8x_person_face.pt) scans the frame at your chosen conf_threshold and iou_threshold, producing person boxes (class 0) and face boxes (class 1).
  2. It associates each face with the person whose bounding box contains the face's center - so faces get paired with the right body, not just the nearest one.
  3. It crops each person's face and body and runs MiVOLO on the pair.
  4. It assembles the results into strings.

The mode dropdown controls what gets detected at all: Use persons and faces (the default, and the smart one - remember, MiVOLO gets a real accuracy bump from seeing body plus face), Use persons only, or Use faces only. The output_selection dropdown picks between All and Largest Person.

Inputs and outputs that matter

  • mivolo_model (required) - from Load MiVOLO Model.
  • detector_model (required) - from Load MiVOLO Detector (YOLO).
  • image (required) - the full frame.
  • mode - persons+faces / persons only / faces only, default Use persons and faces.
  • output_selection - All (default) or Largest Person.
  • conf_threshold - default 0.4, range 0.01–1.0. This is the one beginners actually tune: if the detector is missing people, lower it; if it's firing on background noise, raise it.
  • iou_threshold - default 0.7. Non-max suppression overlap; you can leave this alone unless duplicate boxes appear.

Outputs, all STRING:

  • prediction_text - with All, multi-person results come back as separate lines (Person 1: a 34 year old male, Person 2: ...). With Largest Person, it's a single human-readable prediction.
  • age - All mode returns comma-separated ages (34,27); Largest Person returns one.
  • gender - same pattern, comma-separated in All mode.

The two things that will trip you up

  • Multi-person output is a string, not a list. "All" joins everything into comma-separated strings, and prediction_text is newline-joined. If you want to do anything per-person - "only keep people over 18," for instance - you'll be splitting and parsing strings, and the comma-separated format is exactly what you'll fight. For that kind of logic, Largest Person mode plus a string-to-number conversion is the calmer path.
  • Only the first image in a batch gets processed. Feed a batched IMAGE and it silently keeps [0] (it prints a warning, so the console is your friend). Batch mode for real multi-image workflows isn't built in.

Also note the prediction is a heuristic, not a guarantee - the community uses MiVOLO-class models as age gates and quality checks on AI portraits, and they're genuinely useful for that, but they misjudge around age boundaries often enough that you shouldn't build anything legally load-bearing on it.

Install

Same pack, one install: ComfyUI Manager → search ComfyUI-MiVolo-V2, or:

cd ComfyUI/custom_nodes/
git clone https://github.com/deng-wei/ComfyUI-MiVolo-V2.git
pip install -r requirements.txt

Both models auto-download on first run (MiVOLO into ComfyUI/models/mivolo/, the detector .pt into ComfyUI/models/yolo/). First run is slow - that's the downloads, not a hang. If the detector returns "No objects detected or processed," it's usually the confidence threshold: drop conf_threshold toward 0.25–0.3 and retry.

CategoryMiVOLO/AgeGender

Inputs (7)

NameTypeDefaultDescription
mivolo_modelMIVOLO_MODEL
detector_modelDETECTOR_MODEL
imageIMAGE
modeCOMBO3 options: Use persons and faces, Use persons only, Use faces only
output_selectionCOMBO2 options: All, Largest Person
conf_thresholdFLOAT0.400.01–1
iou_thresholdFLOAT0.700.01–1

Outputs (3)

NameTypeDescription
prediction_textSTRING
ageSTRING
genderSTRING