ComfyUI > Nodes > ComfyUI_Mira > Create Mask With Canvas

ComfyUI Node: Create Mask With Canvas

Class Name

CreateMaskWithCanvas

Category
Mira/Mask
Author
mirabarukaso (Account age: 1261days)
Extension
ComfyUI_Mira
Latest Updated
2024-07-25
Github Stars
0.03K

How to Install ComfyUI_Mira

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

Create Mask With Canvas Description

Generate complex masking patterns with ease using canvas for precise image control and customization.

Create Mask With Canvas:

The CreateMaskWithCanvas node is designed to generate a mask using a canvas, allowing you to create complex masking patterns with ease. This node is particularly useful for AI artists who need to apply specific masking areas to their images, enabling precise control over which parts of the image are affected by subsequent operations. The node can create masks in various positions on the canvas, such as the top-left, top-right, bottom-left, and bottom-right corners, and can combine these masks into a final composite mask. This flexibility makes it an essential tool for tasks that require detailed and customizable masking.

Create Mask With Canvas Input Parameters:

C_Width

The width of the canvas on which the mask will be created. This parameter determines the horizontal dimension of the canvas and affects the overall size of the mask. The value should be an integer representing the number of pixels.

C_Height

The height of the canvas on which the mask will be created. This parameter determines the vertical dimension of the canvas and affects the overall size of the mask. The value should be an integer representing the number of pixels.

Mask_W

The width of the individual mask to be created on the canvas. This parameter controls the horizontal size of the mask and should be an integer. If the mask width is more than half of the canvas width, it will be adjusted to fit within the canvas.

Mask_H

The height of the individual mask to be created on the canvas. This parameter controls the vertical size of the mask and should be an integer. If the mask height is more than half of the canvas height, it will be adjusted to fit within the canvas.

Intenisity

The intensity of the mask, which determines how opaque or solid the mask will be. This parameter is a float value ranging from 0.0 to 1.0, where 1.0 represents a fully opaque mask.

Blur

The amount of blur to apply to the mask. This parameter is a float value that controls the softness of the mask edges. A higher value results in a more blurred mask, while a value of 0 means no blur.

EdgeToEdge

A boolean parameter that determines whether the mask should extend from edge to edge of the canvas. If set to True, the mask will be created from the specified edge positions.

Top_L

A boolean parameter that specifies whether to create a mask in the top-left corner of the canvas. If set to True, a mask will be generated in this position.

Top_R

A boolean parameter that specifies whether to create a mask in the top-right corner of the canvas. If set to True, a mask will be generated in this position.

Bottom_L

A boolean parameter that specifies whether to create a mask in the bottom-left corner of the canvas. If set to True, a mask will be generated in this position.

Bottom_R

A boolean parameter that specifies whether to create a mask in the bottom-right corner of the canvas. If set to True, a mask will be generated in this position.

Create Mask With Canvas Output Parameters:

final_mask

The final composite mask created by combining individual masks generated on the canvas. This output is a tensor representing the mask, which can be used in subsequent image processing operations. The final mask will have the same dimensions as the canvas and will reflect the combined effects of all specified masks and their properties.

Create Mask With Canvas Usage Tips:

  • To create a mask that covers the entire canvas, set the EdgeToEdge parameter to True and ensure the Mask_W and Mask_H parameters are set to the canvas dimensions.
  • Use the Blur parameter to soften the edges of the mask, which can help create more natural transitions between masked and unmasked areas.
  • Combine multiple masks by setting the Top_L, Top_R, Bottom_L, and Bottom_R parameters to True as needed, allowing for complex masking patterns.

Create Mask With Canvas Common Errors and Solutions:

"Mask dimensions exceed canvas size"

  • Explanation: The specified mask width or height is more than half of the canvas dimensions.
  • Solution: Ensure that the Mask_W and Mask_H parameters are set to values that do not exceed half of the C_Width and C_Height respectively.

"Invalid intensity value"

  • Explanation: The Intenisity parameter is set to a value outside the range of 0.0 to 1.0.
  • Solution: Adjust the Intenisity parameter to a value within the valid range (0.0 to 1.0).

"Blur value too high"

  • Explanation: The Blur parameter is set to an excessively high value, causing performance issues or unexpected results.
  • Solution: Reduce the Blur parameter to a more reasonable value to ensure smooth performance and desired mask softness.

Create Mask With Canvas Related Nodes

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