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_widthandcanvas_heightparameters are set to match the dimensions of the image you are working with to avoid any misalignment of masks. - Use the
mask_dataparameter 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_datastring is not formatted correctly, which can prevent the node from parsing the mask regions. - Solution: Ensure that the
mask_datafollows 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_widthorcanvas_heightvalues 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.
