ComfyUI  >  Nodes  >  comfyui_facetools

ComfyUI Extension: comfyui_facetools

Repo Name

comfyui_facetools

Author
dchatel (Account age: 4558 days)
Nodes
View all nodes (8)
Latest Updated
8/6/2024
Github Stars
0.1K

How to Install comfyui_facetools

Install this extension via the ComfyUI Manager by searching for  comfyui_facetools
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter comfyui_facetools in the search bar
After installation, click the  Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

comfyui_facetools Description

comfyui_facetools offers custom nodes for rotation-aware face extraction, pasting, and diverse face masking options, enhancing facial image manipulation and editing capabilities.

comfyui_facetools Introduction

Welcome to comfyui_facetools! This extension is designed to enhance your AI art projects by providing advanced face extraction, alignment, and masking capabilities. Whether you're working on portraits, inpainting, or any other face-related tasks, comfyui_facetools offers a suite of tools to make your workflow more efficient and your results more precise.

Key Features:

  • Rotation-Aware Face Extraction: Detects and extracts faces from images, even if they are rotated.
  • Face Alignment: Aligns faces to a standard orientation for consistent processing.
  • Face Masking Options: Provides various masking techniques to isolate faces, including simple bounding boxes, convex hulls, and occlusion-aware masks.
  • Face Pasting: Allows you to paste edited faces back into the original image seamlessly. By using comfyui_facetools, you can solve common problems such as misaligned faces, inconsistent face detection, and difficulties in face inpainting. This extension is particularly useful for AI artists looking to refine their portrait work or any project involving detailed face manipulation.

How comfyui_facetools Works

At its core, comfyui_facetools uses advanced algorithms to detect, extract, and manipulate faces within images. Here's a simplified breakdown of how it works:

  1. Face Detection: The extension uses models like YOLO (You Only Look Once) to detect faces in an image. This model is efficient and can handle various orientations and sizes of faces.
  2. Face Extraction and Alignment: Once detected, faces are extracted and aligned to a standard orientation. This step ensures that all faces are processed consistently, which is crucial for tasks like inpainting or applying filters.
  3. Masking: Different masking techniques are applied to isolate the face from the background. This can be a simple square mask, a convex hull based on the face mesh, or an occlusion-aware mask using BiSeNet.
  4. Face Pasting: After any modifications, the faces can be pasted back into the original image using a warp matrix, ensuring they fit seamlessly.

comfyui_facetools Features

AlignFaces Node

  • Inputs:
  • insightface: Use the Load InsightFace node from .
  • image: The input image containing faces.
  • threshold: Minimal confidence score for face detection.
  • min_size and max_size: Define the range of face sizes to detect.
  • Outputs:
  • faces: Detected faces.

FaceDetails Node

  • Inputs:
  • faces: Detected faces from the AlignFaces node.
  • crop_size: Size of the square cropped face image.
  • crop_factor: Enlarges the context around the face.
  • mask_type: Type of mask to apply (simple_square, convex_hull, BiSeNet).
  • Outputs:
  • crops: Cropped face images.
  • masks: Masks for each cropped face.
  • warps: Warp matrix to paste the face back.

WarpFacesBack Node

  • Inputs:
  • images: The original image.
  • face: The face to be pasted back.
  • crop: Cropped face images.
  • mask: Masks for the cropped faces.
  • warp: Warp matrix.
  • Outputs:
  • The image with the face pasted back.

OrderedFaceFilter Node

  • Works similarly to ImpactSEGSOrderedfilter.

GenderFaceFilter Node

  • Uses InsightFace gender classifier (note: accuracy may vary).

MergeWarps Node

  • Combines multiple warp matrices (requires further testing).

comfyui_facetools Models

Face Detection Models

  • YOLO: Used for detecting faces in various orientations and sizes.
  • InsightFace: Provides additional face detection and alignment capabilities.

Masking Models

  • BiSeNet: Provides occlusion-aware face segmentation. Download the model .

What's New with comfyui_facetools

Recent Updates:

  • 2024-06-20: Fixed issue .
  • 2024-06-14: YOLO model now uses CUDA if available, improving performance.
  • 2024-05-22: Updated GenderFaceFilter node for better accuracy.
  • 2024-05-19: Added BiSeNetMask and JonathandinuMask nodes. Note: JonathandinuMask is more accurate but requires more memory.
  • 2024-03-10: Switched to using face_yolov8m for face detection instead of InsightFace.

Troubleshooting comfyui_facetools

Common Issues and Solutions:

  1. Faces Not Detected:
  • Ensure the image quality is good and faces are not too small.
  • Adjust the threshold, min_size, and max_size parameters in the AlignFaces node.
  1. Out of Memory Errors:
  • Reduce the image resolution or the number of faces processed simultaneously.
  • Use the BiSeNetMask instead of JonathandinuMask if memory is a concern.
  1. Warping Issues:
  • Ensure the warp matrix is correctly applied. Double-check the inputs to the WarpFacesBack node.

Frequently Asked Questions:

  • Q: Can I use this extension for non-face objects?
  • A: No, this extension is specifically designed for face detection and manipulation.
  • Q: How do I improve the accuracy of face detection?
  • A: Use high-quality images and adjust the detection parameters. Ensure CUDA is enabled for better performance.

Learn More about comfyui_facetools

For more information, tutorials, and community support, check out the following resources:

  • These resources provide additional documentation, example workflows, and a community forum where you can ask questions and share your experiences. Happy creating!

comfyui_facetools Related Nodes

RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.