Visit ComfyUI Online for ready-to-use ComfyUI environment
Extract and process faces from images with advanced cropping and masking options for precise editing and analysis.
The CropFaces
node is designed to extract and process faces from images, providing a streamlined way to focus on facial regions for further analysis or manipulation. This node is particularly useful for AI artists who need to isolate faces from larger images, allowing for detailed editing, enhancement, or transformation of facial features. By leveraging advanced cropping techniques, CropFaces
ensures that the extracted faces are of high quality and appropriately scaled. Additionally, it offers various masking options to refine the cropped regions, making it easier to apply subsequent image processing tasks. The primary goal of this node is to facilitate the precise and efficient extraction of faces, enhancing the overall workflow for creative and technical projects involving facial imagery.
This parameter expects a list of detected faces from an image. Each face is represented by its bounding box coordinates and other relevant metadata. The faces
parameter is crucial as it determines the regions of the image that will be cropped and processed.
The crop_size
parameter defines the dimensions of the cropped face images. It accepts integer values ranging from 512 to 1024, with a default value of 512. This parameter ensures that the cropped faces are of a consistent size, which is essential for uniform processing and analysis.
The crop_factor
parameter controls the scaling factor for the cropping operation. It accepts floating-point values between 1.0 and 3.0, with a default value of 1.5. This parameter allows you to adjust the size of the cropped region relative to the detected face, providing flexibility in how much surrounding context is included in the crop.
The mask_type
parameter specifies the type of mask to be applied to the cropped faces. Available options include simple_square
, convex_hull
, BiSeNet
, and jonathandinu
. Each mask type offers a different method for refining the cropped region, enhancing the accuracy and quality of the extracted faces.
The crops
output parameter provides the cropped face images. These images are extracted based on the specified crop_size
and crop_factor
, ensuring that each face is isolated and ready for further processing or analysis.
The masks
output parameter delivers the masks applied to the cropped faces. These masks help to refine the cropped regions, ensuring that only the relevant facial areas are included. The type of mask applied is determined by the mask_type
input parameter.
The warps
output parameter contains the transformation matrices used during the cropping process. These matrices are essential for understanding how the original image was transformed to produce the cropped faces, providing valuable information for any subsequent image processing tasks.
faces
input parameter is populated with accurately detected faces. Using a reliable face detection method will significantly enhance the quality of the cropped outputs.crop_factor
values to find the optimal balance between the face and its surrounding context. This can be particularly useful when you need to include some background or additional facial features in the crop.mask_type
based on your specific needs. For instance, convex_hull
is ideal for more precise facial region extraction, while simple_square
provides a quick and straightforward mask.faces
input parameter is empty, meaning no faces were detected in the image.crop_size
parameter is set to a value outside the allowed range (512 to 1024).crop_size
parameter to a valid value within the specified range.crop_factor
parameter is set to a value outside the allowed range (1.0 to 3.0).crop_factor
parameter to a valid value within the specified range.mask_type
is specified.mask_type
parameter is set to one of the supported values: simple_square
, convex_hull
, BiSeNet
, or jonathandinu
.© Copyright 2024 RunComfy. All Rights Reserved.