ComfyUI > Nodes > ComfyUI-YCNodes_Toolkit > Canvas BBox Mask

ComfyUI Node: Canvas BBox Mask

Class Name

ycCanvasBBoxMask

Category
YCNode/Mask
Author
yichengup (Account age: 774days)
Extension
ComfyUI-YCNodes_Toolkit
Latest Updated
2026-03-23
Github Stars
0.05K

How to Install ComfyUI-YCNodes_Toolkit

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

Canvas BBox Mask Description

The ycCanvasBBoxMask node enables creating and managing up to ten mask regions for precise image editing.

Canvas BBox Mask:

The ycCanvasBBoxMask node is designed to facilitate the creation and management of multiple mask regions on a canvas. This node is particularly useful for AI artists who need to define specific areas on a canvas for masking purposes, allowing for precise control over which parts of an image are affected by subsequent operations. By enabling the creation of up to ten individual masks, each represented as a white area on the canvas, this node provides a flexible and powerful tool for image manipulation. The node also outputs a batch of masks, which includes all defined mask regions, making it easier to apply consistent transformations or effects across multiple areas. This functionality is essential for tasks that require selective editing or processing of image regions, such as compositing, retouching, or applying localized effects.

Canvas BBox Mask Input Parameters:

canvas_width

The canvas_width parameter specifies the width of the canvas on which the masks will be applied. It determines the horizontal dimension of the canvas and influences the size and positioning of the mask regions. The value must be an integer, with a minimum of 64 and a maximum of 4096, and the default is set to 512. Adjusting this parameter allows you to tailor the canvas size to your specific project needs, ensuring that the masks are accurately placed and scaled.

canvas_height

The canvas_height parameter defines the height of the canvas, setting the vertical dimension for the mask application. Similar to canvas_width, this parameter is an integer with a minimum value of 64 and a maximum of 4096, with a default of 512. This parameter is crucial for ensuring that the masks fit within the intended canvas area, allowing for precise vertical placement and scaling of mask regions.

mask_data

The mask_data parameter is a string that contains the coordinates and dimensions of the mask regions in the format "x1,y1,w1,h1;x2,y2,w2,h2;...". This parameter allows you to define multiple mask regions by specifying their top-left corner coordinates (x, y) and their width and height. The data is parsed to create individual masks on the canvas, and it supports multiline input for ease of use. This parameter is essential for customizing the mask layout and ensuring that each region is accurately represented on the canvas.

Canvas BBox Mask Output Parameters:

mask_1

The mask_1 output represents the first individual mask created on the canvas. It is a binary mask where the specified region is white (1.0), indicating the masked area, while the rest of the canvas is black (0.0). This output is useful for applying effects or transformations to a specific area of the image.

mask_2

The mask_2 output corresponds to the second individual mask on the canvas, following the same binary format as mask_1. It allows for the isolation and manipulation of a different region on the canvas, providing flexibility in image processing tasks.

mask_3

The mask_3 output is the third individual mask, offering another distinct region for targeted image editing. Like the previous masks, it is a binary representation of the specified area.

mask_4

The mask_4 output provides the fourth individual mask, enabling further segmentation of the canvas for selective processing.

mask_5

The mask_5 output is the fifth individual mask, continuing the pattern of allowing specific regions to be isolated and manipulated.

mask_6

The mask_6 output represents the sixth individual mask, offering additional flexibility in defining and working with multiple canvas regions.

mask_7

The mask_7 output is the seventh individual mask, providing another layer of segmentation for detailed image editing.

mask_8

The mask_8 output corresponds to the eighth individual mask, supporting complex compositions by isolating yet another region.

mask_9

The mask_9 output is the ninth individual mask, further expanding the capability to work with multiple distinct areas on the canvas.

mask_10

The mask_10 output represents the tenth and final individual mask, completing the set of available masks for comprehensive image manipulation.

mask_batch

The mask_batch output is a composite of all the individual masks, stacked together to form a batch. This output is particularly useful for operations that need to be applied consistently across all defined mask regions, streamlining the workflow for batch processing tasks.

width

The width output provides the width of the canvas, confirming the horizontal dimension used for mask creation. This information is useful for verifying the canvas size and ensuring that the masks are correctly aligned.

height

The height output gives the height of the canvas, confirming the vertical dimension used in the process. It serves as a check to ensure that the masks fit within the intended canvas area.

Canvas BBox Mask Usage Tips:

  • Ensure that the canvas_width and canvas_height parameters are set to match the dimensions of the image you are working with to avoid any misalignment of masks.
  • Use the mask_data parameter to precisely define the regions you want to mask. Double-check the coordinates and dimensions to ensure they accurately represent the desired areas on the canvas.

Canvas BBox Mask Common Errors and Solutions:

Invalid mask_data format

  • Explanation: The mask_data string is not formatted correctly, which can prevent the node from parsing the mask regions.
  • Solution: Ensure that the mask_data follows the correct format "x1,y1,w1,h1;x2,y2,w2,h2;..." and that each coordinate and dimension is separated by commas and each mask region by semicolons.

Canvas dimensions out of range

  • Explanation: The canvas_width or canvas_height values are outside the allowed range of 64 to 4096.
  • Solution: Adjust the canvas dimensions to fall within the specified range to ensure proper mask creation and alignment.

Canvas BBox Mask Related Nodes

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

Canvas BBox Mask