ComfyUI Extension
comfyui_facetools
These custom nodes provide a rotation aware face extraction, paste back, and various face related masking options.
dchatel/comfyui_facetools
Nodes8
On cloudLocal install
Categoryfacetools
Stars183
Updated11 months ago
Nodes (8)
BiSeNet Mask
Pick exactly which face parts survive into your mask
facetools
CropFaces
Upright face crops, ready-made masks, and the warp that puts it all back
facetools
DetectFaces
The face-finder that knows which way a face is pointing
facetools
Gender Face Filter
Split a batch of faces by a classifier, with the author's own caveat
facetools
Jonathandinu Mask
The more accurate face-parsing mask that eats VRAM
facetools
Merge Warps
The abandoned node for merging two face streams (read this before trusting it)
facetools
Ordered Face Filter
Grab the biggest face in the batch, keep the rest
facetools
Warp Faces Back
The paste-back that leaves everything but the face alone
facetools
Readme
comfyui_facetools
These custom nodes provide a rotation aware face extraction, paste back, and various face related masking options.

Patch notes
- 2024-06-20 - fixed issue 13
- 2024-06-14 - Sent yolo to cuda device if available (credits: kilroythethird, thanks for the suggestion!)
- 2024-06-14 - Dropped the requirement from insightface completely.
- 2024-05-22 - Updated GenderFaceFilter node.
- 2024-05-19 - Added BiSeNetMask and JonathandinuMask nodes. Careful about JonathandinuMask, it's more accurate than BiSeNet, but it takes more memory; you can get out of memory more easily with it.
- 2024-03-10 - Added nodes to detect faces using
face_yolov8minstead ofinsightface.
Example Workflows
- Full inpainting workflow with two controlnets which allows to get as high as 1.0 denoise strength without messing things up.

Nodes
AlignFaces- inputs:
- insightface: Use the
Load InsightFacenodefrom ComfyUI_IPAdapter_plus - image
- threshold: minimal confidence score for detection
- min_size: minimum face size for detection
- max_size: maximum face size for detection
- insightface: Use the
- outputs:
- faces
- inputs:
FaceDetails- inputs:
- faces
- crop_size: size of the square cropped face image
- crop_factor: enlarge the context around the face by this factor
- mask_type:
- simple_square: simple bounding box around the face
- convex_hull: convex hull based on the face mesh obtained with MediaPipe
- BiSeNet: occlusion aware face segmentation based on face-parsing.PyTorch
- outputs:
- crops: square cropped face images
- masks: masks for each cropped face
- warps: 2x3 warp matrix to paste the cropped face back into the original image
- inputs:
WarpFacesBack- input:
- images: this is the original image
- face
- crop: cropped face images
- mask: masks for the cropped faces
- warp: 2x3 warp matrix
- input:
OrderedFaceFilter- works similarly to
ImpactSEGSOrderedfilter
- works similarly to
GenderFaceFilter- needs more work, as InsightFace gender classifier isn't very accurate.
MergeWarps- I made some changes in
FaceDetailerandWarpFacesBacksince I've created this one, so it probably doesn't work anymore. Needs more testing and more work.
- I made some changes in
Installation
- Download bluefoxcreation/FaceAlignment model into
ComfyUI/models/landmarks - (Only if you want to use occlusion aware masks) Download BiSeNet model into
ComfyUI/models/bisenet
DEPRECATED:
- You need ComfyUI-Impact-Pack for
Load InsightFacenode and comfyui_controlnet_aux for MediaPipe library (which is required for convex_hull masks) andMediaPipe Face Meshnode if you want to use that controlnet.