ComfyUI > Nodes > ComfyUI 1hewNodes > Image BBox Overlay by Mask

ComfyUI Node: Image BBox Overlay by Mask

Class Name

1hew_ImageBBoxOverlayByMask

Category
1hewNodes/image
Author
1hew (Account age: 1113days)
Extension
ComfyUI 1hewNodes
Latest Updated
2026-04-17
Github Stars
0.03K

How to Install ComfyUI 1hewNodes

Install this extension via the ComfyUI Manager by searching for ComfyUI 1hewNodes
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI 1hewNodes 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
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Image BBox Overlay by Mask Description

Overlays bounding boxes on images using mask data, with customizable color and stroke options.

Image BBox Overlay by Mask:

The 1hew_ImageBBoxOverlayByMask node is designed to enhance image processing by overlaying bounding boxes on images based on mask data. This node is particularly useful for AI artists who want to visually highlight specific regions of an image that are defined by a mask. By converting mask data into bounding boxes, this node allows you to easily identify and emphasize areas of interest within an image. The node supports both single and multiple bounding box overlays, depending on the configuration, and offers customization options such as color, stroke width, and fill. This flexibility makes it a powerful tool for creating visually compelling compositions and for tasks that require precise region identification.

Image BBox Overlay by Mask Input Parameters:

image

The image parameter is a tensor representing the input image on which the bounding boxes will be overlaid. It is crucial for the image to be in the correct format, typically a 3D or 4D tensor, to ensure proper processing. The image serves as the canvas for the bounding box overlay, and its dimensions must match those of the mask for accurate results.

mask

The mask parameter is a tensor that defines the regions of interest within the image. This mask is used to calculate the bounding boxes that will be drawn on the image. The mask should be a 2D or 3D tensor, and its size should correspond to the image dimensions. The mask acts as a guide for the node to determine where the bounding boxes should be placed.

bbox_color

The bbox_color parameter specifies the color of the bounding boxes. It accepts predefined color names such as "red", "green", "blue", "yellow", "cyan", "magenta", "white", and "black". This parameter allows you to customize the appearance of the bounding boxes to suit your artistic needs or to ensure they stand out against the image background.

stroke_width

The stroke_width parameter determines the thickness of the bounding box lines. It must be a positive integer, with a minimum value of 1. This parameter allows you to adjust the prominence of the bounding boxes, making them more or less noticeable depending on the desired effect.

fill

The fill parameter is a boolean that indicates whether the bounding boxes should be filled with color. If set to true, the boxes will be filled with the specified color; otherwise, only the outlines will be drawn. This option provides additional flexibility in how the bounding boxes are rendered, allowing for either subtle or bold visual effects.

padding

The padding parameter is an integer that adds extra space around the bounding boxes. It can be used to ensure that the boxes do not tightly hug the masked regions, providing a buffer that can enhance visual clarity. The padding value must be non-negative.

output_mode

The output_mode parameter determines how the bounding boxes are generated from the mask. It can be set to either "merge" or "separate". In "merge" mode, a single bounding box is created around all masked regions, while "separate" mode generates individual boxes for each distinct region. This parameter allows you to control the granularity of the bounding box overlay.

Image BBox Overlay by Mask Output Parameters:

output_image

The output_image parameter is a tensor representing the image with the overlaid bounding boxes. This output is the final result of the node's processing, providing a visual representation of the masked regions highlighted by the bounding boxes. The output image retains the original image's dimensions and format, ensuring compatibility with subsequent processing steps or display.

Image BBox Overlay by Mask Usage Tips:

  • To ensure the bounding boxes are clearly visible, choose a bbox_color that contrasts well with the image background.
  • Use the padding parameter to add space around the bounding boxes, which can help in distinguishing the highlighted regions from the rest of the image.

Image BBox Overlay by Mask Common Errors and Solutions:

invalid bbox_color

  • Explanation: The specified bbox_color is not one of the predefined options.
  • Solution: Ensure that the bbox_color is set to one of the following: "red", "green", "blue", "yellow", "cyan", "magenta", "white", or "black".

invalid output_mode

  • Explanation: The output_mode is set to an unsupported value.
  • Solution: Set the output_mode to either "merge" or "separate" to ensure proper functionality.

invalid stroke_width or padding

  • Explanation: The stroke_width is less than 1, or the padding is negative.
  • Solution: Adjust the stroke_width to be at least 1 and ensure the padding is non-negative.

Image BBox Overlay by Mask Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI 1hewNodes
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.

Image BBox Overlay by Mask