Visit ComfyUI Online for ready-to-use ComfyUI environment
Automatically detect and crop faces from images with optional padding for well-centered focus.
The Image Crop Face node is designed to automatically detect and crop faces from an image, providing a focused and enhanced view of the subject. This node leverages face detection algorithms to identify the facial region within an image and crops it with optional padding to ensure the face is well-centered and not too tightly cropped. This functionality is particularly useful for AI artists who need to isolate faces for further processing, editing, or analysis, ensuring that the most important part of the image is highlighted. By using this node, you can streamline your workflow, save time on manual cropping, and achieve consistent results across multiple images.
This parameter takes the input image from which the face will be detected and cropped. The image should be in a format that is compatible with the node's processing capabilities, such as a tensor or a PIL image. The quality and resolution of the input image can impact the accuracy of face detection and the quality of the cropped output.
This optional parameter allows you to specify the name of the Haar cascade file used for face detection. Haar cascades are pre-trained classifiers used to detect objects in images. If not provided, a default cascade will be used. The choice of cascade can affect the detection accuracy and speed.
This parameter defines the amount of padding to be added around the detected face in the cropped image. It is specified as a fraction of the face size, with a default value of 0.25. Increasing the padding value will result in a larger cropped area around the face, while decreasing it will make the crop tighter. The padding value should be chosen based on the desired framing of the face in the final image.
This output parameter provides the cropped image containing the detected face. The cropped image is resized to ensure it fits within the specified dimensions, maintaining the aspect ratio and quality. This output can be directly used for further processing or analysis.
This output parameter contains metadata about the crop, including the size of the cropped image and the coordinates of the crop box (left, top, right, bottom). This information can be useful for understanding the position and size of the cropped region within the original image.
© Copyright 2024 RunComfy. All Rights Reserved.