ComfyUI Extension: ComfyUI-MiVolo-V2
ComfyUI nodes for MiVolo V2 Age & Gender Prediction (based on iitolstykh/mivolo_v2)
Custom Nodes (0)
README
ComfyUI MiVolo V2 Node
Use the advanced MiVolo V2 model directly in ComfyUI for high-precision age and gender prediction!
This project is a ComfyUI wrapper node for the iitolstykh/mivolo_v2 model. MiVolo is a Transformer-based, multi-input (face and body) model that provides reliable age and gender estimations.
đ Core Features
- Age Estimation: Receives an image (containing a face or body) and outputs the predicted age as a string.
- Gender Estimation: Outputs the predicted gender (e.g., Male/Female) as a string.
- Multi-Person Support: Automatically processes face and body crops to improve accuracy (based on the original model's capabilities).
đŧī¸ Nodes and Workflow Examples
Example Workflow:

đ How to Install
1. (Recommended) Use ComfyUI Manager
- Open ComfyUI Manager.
- Click "Install Custom Nodes".
- Search for
ComfyUI-MiVolo-V2and install it. - Restart ComfyUI.
2. (Manual) Git Clone
- Open a terminal and navigate to your ComfyUI
custom_nodesdirectory:cd ComfyUI/custom_nodes/ - Clone this repository:
(Please replacegit clone [https://github.com/](https://github.com/)[YourUsername]/ComfyUI-MiVolo-V2.git[YourUsername]with your actual GitHub username) - Install the dependencies:
pip install -r requirements.txt - Restart ComfyUI.
đĻ Model Installation
This custom node requires two types of models:
- MiVOLO Age/Gender Model (for prediction)
- YOLO Detector Model (for finding faces and bodies, optional)
This project supports both automatic downloading and manual placement of models.
1. MiVOLO Age/Gender Model (MiVOLOLoader)
This is the main prediction model.
- Model Name:
iitolstykh/mivolo_v2 - Storage Path:
ComfyUI/models/mivolo/
Method A: Automatic Download (Recommended)
- The code is configured to handle this automatically.
- In ComfyUI, add the "Load MiVOLO Model" node.
- In the
model_namefield, keep the default"iitolstykh/mivolo_v2"selected. - The first time you run a workflow, the
transformerslibrary will automatically download this model from Hugging Face and cache it on your system.
Method B: Manual Download
If you want to manage models manually or use them in an offline environment:
- Visit the Hugging Face repo: https://huggingface.co/iitolstykh/mivolo_v2
- Download or
git clonethe entire repository. - Ensure all model files (like
config.json,pytorch_model.bin, etc.) are located in a folder named after the model. - Place this folder inside the
mivolodirectory in your ComfyUImodelsdirectory.
The final path structure should be:
ComfyUI/
âââ models/
âââ mivolo/
âââ iitolstykh/mivolo_v2/
âââ config.json
âââ configuration_mivolo.py
âââ modeling_mivolo.py
âââ pytorch_model.bin
âââ ... (and all other files)
Once done, the "Load MiVOLO Model" node will automatically detect it in the dropdown list.
2. YOLO Detector Model (MiVOLODetectorLoader)
This is a .pt file used to detect people and faces in an image.
- Model Name:
yolov8x_person_face.pt - Hugging Face Repo:
iitolstykh/demo_yolov8_detector - Storage Path:
ComfyUI/models/yolo/
Method A: Automatic Download (Recommended)
- In ComfyUI, add the "Load MiVOLO Detector (YOLO)" node.
- Keep the default
model_nameselected:"iitolstykh/demo_yolov8_detector/yolov8x_person_face.pt". - The first time you run a workflow, the script will check the
ComfyUI/models/yolo/folder. - If the
yolov8x_person_face.ptfile is not found, the script will automatically download it from Hugging Face and place it in the correctyolofolder.
Method B: Manual Download
If you prefer to download it manually:
- Visit the Hugging Face repo: https://huggingface.co/iitolstykh/demo_yolov8_detector/tree/main
- Download the single file
yolov8x_person_face.pt. - Place this file in the
yolodirectory under your ComfyUImodelsdirectory. (Create theyolofolder if it doesn't exist).
The final path structure should be:
ComfyUI/
âââ models/
âââ yolo/
âââ yolov8x_person_face.pt
Once done, the "Load MiVOLO Detector (YOLO)" node will be able to load the model immediately.
đĄ Usage Tips
- For best results, ensure the input image is clear and the face/body is visible.
- Supports using pre-cropped faces as input, as well as automatic detection.
- Can be used to analyze AI-generated portraits or for conditional control based on age/gender.
đ Acknowledgments and License
This project is Adapted Material based on iitolstykh/mivolo_v2.
- Original Model:
iitolstykh/mivolo_v2(Hugging Face) - Original Papers:
- Original License: The original project uses a custom license based on CC BY-SA 4.0. See the original repository's LICENSE file for details.
In accordance with the original license's "ShareAlike" condition, this ComfyUI node project is also open-sourced under the Creative Commons Attribution-ShareAlike 4.0 (CC BY-SA 4.0) license.
This means you are free to use, modify, and distribute this project, provided you give appropriate attribution and share your adaptations under the same license.
đ Bug Reports
If you encounter any issues or have feature suggestions, please feel free to open an Issue on the "Issues" page!