This commit introduces a ControlNet Auxiliary Preprocessor for facial landmark detection using MediaPipe FaceMesh. It also adds utility nodes to work with the detected landmarks: - Node to draw the facial mesh on an image using landmark data. - Node to generate masks based on landmark data. --------- Co-authored-by: ryanontheinside <ryanfosdick87@gmail.com>
22 lines
711 B
Python
22 lines
711 B
Python
"""Provides nodes for facial landmark detection and utilities using MediaPipe FaceMesh.
|
|
Inspired by the ComfyUI ControlNet Auxiliary MediaPipe Face node.
|
|
|
|
References:
|
|
https://github.com/Fannovel16/comfyui_controlnet_aux/blob/main/src/custom_controlnet_aux/mediapipe_face/mediapipe_face_common.py
|
|
"""
|
|
|
|
from ..src.media_pipe.face_mesh import *
|
|
|
|
NODE_CLASS_MAPPINGS = {
|
|
"FaceMeshNode": FaceMeshNode,
|
|
"FaceMeshDrawNode": FaceMeshDrawNode,
|
|
"FaceMeshMaskNode": FaceMeshMaskNode,
|
|
}
|
|
NODE_DISPLAY_NAME_MAPPINGS = {
|
|
"FaceMeshNode": "Face Mesh",
|
|
"FaceMeshDrawNode": "Face Mesh Draw",
|
|
"FaceMeshMaskNode": "Face Region Mask",
|
|
}
|
|
|
|
__all__ = ["FaceMeshNode", "FaceMeshDrawNode", "FaceMeshMaskNode"]
|