Visit ComfyUI Online for ready-to-use ComfyUI environment
Automated mask generation for precise element enhancement in images, focusing on faces, hands, and people.
Image Masking is a powerful tool designed to intelligently detect and generate masks for specific elements within images, with a particular focus on faces, hands, and people. Utilizing advanced detection models, this feature significantly enhances the inpainting workflow by automatically creating precise masks around detected elements. This allows for targeted enhancement and detailing, making it easier to refine specific areas of an image without affecting the surrounding content. The node is optimized to work seamlessly with various detection models, ensuring high accuracy and efficiency in mask generation, which is crucial for artists looking to achieve professional-level results in their digital artwork.
This parameter specifies the input image that will be processed for mask generation. It is the starting point for the node's operation, as the image provided here will be analyzed to detect and mask specific elements.
This parameter allows you to select the specialized detection model to be used for mask generation. Options include models optimized for detecting faces, hands, and people, such as face_yolov8n
, mediapipe_face_full
, and hand_yolov8n
. The default model is face_yolov8n
. Choosing the right model is crucial for achieving accurate mask generation based on the elements you wish to target.
This parameter sets the confidence threshold for detections. Only elements with confidence scores above this threshold will be included in the mask. The default value is 0.25, with a range from 0 to 1, allowing you to adjust the sensitivity of the detection process to suit your needs.
This parameter limits the maximum number of elements (such as faces, hands, or people) that will be detected and masked in the image. The default is 6, with a range from 1 to 20. This helps manage the complexity of the mask generation process by focusing on the most prominent elements.
This parameter extends or reduces the detected mask area by a specified number of pixels. Positive values create a larger masked region, while negative values shrink the mask. The default is 4, with a range from -40 to 40, allowing for flexibility in how much of the surrounding area is included in the mask.
This parameter applies a gradual fade-out effect to the mask, extending it by a specified number of pixels to create smooth transitions between masked and unmasked regions. The default is 4, with a range from 0 to 20, which can be adjusted to achieve the desired level of blending.
This parameter specifies the format in which the output image will be saved. The default format is WEBP
, but it can be adjusted based on your requirements for the final output.
This output provides the original input image, allowing you to compare the processed results with the initial content.
This output offers a preview of the generated mask, giving you a visual representation of the areas that have been detected and masked. This is useful for verifying the accuracy of the mask before applying further processing.
This output delivers the final mask, which can be used for inpainting or other image editing tasks. The mask highlights the detected elements, enabling precise modifications to specific areas of the image.
mediapipe_face_full
for detailed facial features.Confidence
parameter to fine-tune the sensitivity of the detection process. Lower values may include more elements, while higher values ensure only the most confident detections are masked.Mask Padding
and Mask Blur
to control the extent and smoothness of the mask edges, which can help achieve more natural-looking results in your final image.Max Detections
parameter if you need to detect more elements, or reduce the number of elements in the image.RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Playground, enabling artists to harness the latest AI tools to create incredible art.