ComfyUI > Nodes > ComfyUI_LayerStyle_Advance > LayerMask: Draw BBox Mask V2(Advance)

ComfyUI Node: LayerMask: Draw BBox Mask V2(Advance)

Class Name

LayerMask: DrawBBoxMaskV2

Category
😺dzNodes/LayerMask
Author
chflame163 (Account age: 701days)
Extension
ComfyUI_LayerStyle_Advance
Latest Updated
2025-03-09
Github Stars
0.18K

How to Install ComfyUI_LayerStyle_Advance

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

LayerMask: Draw BBox Mask V2(Advance) Description

Enhance image processing with bounding box masks for precise region manipulation and control.

LayerMask: Draw BBox Mask V2(Advance):

The LayerMask: DrawBBoxMaskV2 node is designed to enhance image processing by generating masks based on bounding boxes. This node is particularly useful for AI artists who need to manipulate or analyze specific regions within an image. By drawing bounding box masks, it allows for precise control over which areas of an image are affected by subsequent operations. The node provides flexibility in adjusting the bounding boxes, enabling users to expand or contract the mask area as needed. This capability is essential for tasks that require detailed attention to specific image sections, such as object detection, segmentation, or artistic effects. The node's ability to handle rounded rectangles and apply anti-aliasing further enhances the quality and smoothness of the masks, making it a valuable tool for creating professional-grade image modifications.

LayerMask: Draw BBox Mask V2(Advance) Input Parameters:

image

The image parameter is the input image on which the bounding box masks will be drawn. It serves as the canvas for the mask creation process, and the quality and resolution of this image can affect the final output.

bboxes

The bboxes parameter represents the bounding boxes that define the areas to be masked. These are typically provided as a list of coordinates, specifying the top-left and bottom-right corners of each box. The bounding boxes determine the regions of interest within the image.

grow_top

The grow_top parameter allows you to expand the bounding box upwards by a specified proportion of its height. This parameter accepts a float value ranging from -10 to 10, with a default of 0. Positive values increase the height of the bounding box upwards, while negative values decrease it.

grow_bottom

Similar to grow_top, the grow_bottom parameter adjusts the bounding box downwards. It accepts a float value from -10 to 10, with a default of 0. This parameter is useful for fine-tuning the vertical extent of the mask.

grow_left

The grow_left parameter modifies the bounding box to the left by a specified proportion of its width. It accepts a float value between -10 and 10, with a default of 0. This allows for precise control over the horizontal expansion or contraction of the mask.

grow_right

The grow_right parameter adjusts the bounding box to the right. It accepts a float value from -10 to 10, with a default of 0. This parameter is essential for customizing the horizontal reach of the mask.

rounded_rect_radius

The rounded_rect_radius parameter defines the radius of the corners for rounded rectangles. It accepts an integer value between 0 and 100, with a default of 50. This parameter is crucial for creating masks with smooth, rounded edges.

anti_aliasing

The anti_aliasing parameter controls the level of anti-aliasing applied to the mask edges. It accepts an integer value from 0 to 16, with a default of 2. Higher values result in smoother edges, reducing the jagged appearance of the mask.

LayerMask: Draw BBox Mask V2(Advance) Output Parameters:

mask

The mask output parameter is the resulting mask generated from the specified bounding boxes. This mask highlights the areas of interest within the input image, allowing for further processing or analysis. The mask is typically a binary image where the masked regions are marked, providing a clear delineation of the selected areas.

LayerMask: Draw BBox Mask V2(Advance) Usage Tips:

  • Adjust the grow_top, grow_bottom, grow_left, and grow_right parameters to fine-tune the size of your bounding boxes, ensuring they accurately cover the desired regions.
  • Use the rounded_rect_radius parameter to create masks with smooth, rounded edges, which can be particularly useful for artistic effects or when working with circular objects.
  • Increase the anti_aliasing value to improve the smoothness of the mask edges, especially when working with high-resolution images or when precise edge definition is required.

LayerMask: Draw BBox Mask V2(Advance) Common Errors and Solutions:

Invalid bbox after extend: (x1,y1,x2,y2)

  • Explanation: This error occurs when the bounding box coordinates become invalid after applying the grow parameters, resulting in a situation where the top-left corner is below or to the right of the bottom-right corner.
  • Solution: Ensure that the grow parameters are set to values that maintain valid bounding box dimensions. Adjust the grow values to prevent the coordinates from overlapping or inverting.

No object found

  • Explanation: This message indicates that no objects were detected within the specified bounding boxes, possibly due to incorrect coordinates or an empty input.
  • Solution: Verify that the bounding boxes are correctly defined and encompass the intended objects. Check the input image and bounding box data for accuracy.

LayerMask: Draw BBox Mask V2(Advance) Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI_LayerStyle_Advance
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 Playground, enabling artists to harness the latest AI tools to create incredible art.