ComfyUI > Nodes > comfyui-easyapi-nodes > InsightFaceBBOXDetect

ComfyUI Node: InsightFaceBBOXDetect

Class Name

InsightFaceBBOXDetect

Category
EasyApi/Detect
Author
lldacing (Account age: 2147days)
Extension
comfyui-easyapi-nodes
Latest Updated
2024-08-14
Github Stars
0.04K

How to Install comfyui-easyapi-nodes

Install this extension via the ComfyUI Manager by searching for comfyui-easyapi-nodes
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter comfyui-easyapi-nodes 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

InsightFaceBBOXDetect Description

Facial detection and analysis node with customizable bounding boxes for AI artists using InsightFace model.

InsightFaceBBOXDetect:

InsightFaceBBOXDetect is a powerful node designed to detect and analyze faces within an image using the InsightFace model. This node leverages advanced facial recognition technology to identify faces and draw bounding boxes around them, making it an essential tool for AI artists who need to process and analyze facial features in their artwork. The node can sort detected faces based on various criteria such as position and size, and it offers options to customize the appearance of the bounding boxes, including shape and color. By providing detailed facial detection and customization options, InsightFaceBBOXDetect enhances the ability to manipulate and understand facial data in creative projects.

InsightFaceBBOXDetect Input Parameters:

image

The image parameter is the input image in which faces will be detected. This image should be provided in a format compatible with the node, typically as a tensor or PIL image. The quality and resolution of the input image can significantly impact the accuracy of face detection.

shape

The shape parameter determines the shape of the bounding box drawn around detected faces. Options include 'rectangle' and 'circle'. Choosing the appropriate shape can help in better visualizing the detected faces according to the artistic needs.

shape_color

The shape_color parameter specifies the color of the bounding box. This should be provided in a hex color code format (e.g., '#FF0000' for red). The color choice can enhance the visibility of the bounding boxes against different backgrounds.

show_num

The show_num parameter is a boolean that indicates whether to display numbers on the bounding boxes. When set to True, each detected face will be numbered, which can help in identifying and referencing specific faces in the image.

num_color

The num_color parameter defines the color of the numbers displayed on the bounding boxes. This should be provided in a hex color code format. Choosing a contrasting color to the shape_color ensures that the numbers are easily readable.

num_pos

The num_pos parameter specifies the position of the numbers on the bounding boxes. Options include 'left-top', 'right-top', 'left-bottom', and 'right-bottom'. This allows for flexible placement of numbers to avoid overlapping with important facial features.

num_sort

The num_sort parameter determines the sorting order of the detected faces. Options include 'reactor', 'left-right', 'right-left', 'top-bottom', 'bottom-top', 'small-large', and 'large-small'. Sorting can help in organizing the faces in a logical order for further processing or analysis.

INSIGHTFACE

The INSIGHTFACE parameter allows you to provide a pre-initialized InsightFace model. If not provided, the node will initialize its own model. This parameter is useful for reusing an existing model and saving initialization time.

InsightFaceBBOXDetect Output Parameters:

image_with_bbox

The image_with_bbox parameter is the output image with bounding boxes drawn around the detected faces. This image is returned in a format suitable for further processing or display, typically as a tensor or PIL image.

bbox_json

The bbox_json parameter provides the bounding box coordinates in JSON format. This output is useful for programmatically accessing the bounding box data for each detected face, enabling further analysis or manipulation.

num_faces

The num_faces parameter indicates the total number of faces detected in the input image. This count can be useful for understanding the extent of face detection and for validating the results.

model

The model parameter returns the InsightFace model used for detection. This can be useful for debugging or for reusing the model in subsequent operations without reinitializing it.

InsightFaceBBOXDetect Usage Tips:

  • Ensure the input image is of high quality and resolution to improve the accuracy of face detection.
  • Use contrasting colors for shape_color and num_color to enhance the visibility of bounding boxes and numbers.
  • Experiment with different num_sort options to find the most logical order for your specific use case.
  • If you have an existing InsightFace model, provide it through the INSIGHTFACE parameter to save initialization time.

InsightFaceBBOXDetect Common Errors and Solutions:

"Model not initialized"

  • Explanation: This error occurs when the InsightFace model is not properly initialized.
  • Solution: Ensure that the model is correctly loaded and initialized before running the detection. Check the model path and initialization parameters.

"Invalid image format"

  • Explanation: This error occurs when the input image is not in a compatible format.
  • Solution: Convert the input image to a tensor or PIL image format before passing it to the node.

"Color code format error"

  • Explanation: This error occurs when the shape_color or num_color parameters are not provided in a valid hex color code format.
  • Solution: Ensure that the color codes are in the correct hex format (e.g., '#FF0000' for red).

"Invalid shape option"

  • Explanation: This error occurs when an unsupported shape option is provided.
  • Solution: Use only the supported shape options ('rectangle' or 'circle') for the shape parameter.

InsightFaceBBOXDetect Related Nodes

Go back to the extension to check out more related nodes.
comfyui-easyapi-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.