A custom node for ComfyUI designed to detect and crop faces using OpenCV Haar cascades, this tool offers full support for the ComfyUI v3 schema while maintaining compatibility with earlier versions. It streamlines workflows for video processing and avatar creation by providing reliable face detection capabilities.
- Supports adaptive padding and temporal smoothing to enhance face cropping accuracy.
- Allows batch processing of images with options for output format and aspect ratios.
- Provides dual classifiers and robust error signaling for improved user experience.
Context
This tool is a specialized node within ComfyUI that leverages OpenCV's Haar cascades for the precise detection and cropping of faces in images and video frames. Its primary purpose is to facilitate the creation of applications that require face recognition or avatar generation, making it a vital addition for users working with visual content.
Key Features & Benefits
The node includes several practical features that enhance its usability:
- Auto-Padding adjusts the cropping area based on the size of detected faces, eliminating the need for manual input of padding values.
- Temporal Smoothing reduces jitter in video by averaging bounding box coordinates across frames, ensuring smoother transitions during batch processing.
- Aspect Ratio Presets allow users to select from common formats, ensuring that the output meets specific display requirements without manual recalculation.
Advanced Functionalities
The tool includes advanced capabilities such as dual classifiers, allowing users to choose between different Haar cascade models for face detection. This flexibility can improve detection rates in varied lighting conditions or orientations. Additionally, it features proper error signaling that provides feedback when no face is detected, enhancing the debugging process.
Practical Benefits
By integrating this face detection node into their workflows, users can significantly improve their efficiency and control over image processing tasks. The ability to handle batch processing and maintain compatibility with legacy workflows ensures that both new and existing users can benefit from the tool without disruption. Overall, this leads to higher quality outputs and a more streamlined creative process within ComfyUI.
Credits/Acknowledgments
This tool is developed by contributors to the ComfyUI community and is licensed under the Apache License Version 2.0, allowing for open-source use and modification. For further details, please refer to the LICENSE file included in the repository.




