ComfyUI  >  Nodes  >  Masquerade Nodes >  Constant Mask

ComfyUI Node: Constant Mask

Class Name

Constant Mask

Category
Masquerade Nodes
Author
BadCafeCode (Account age: 485 days)
Extension
Masquerade Nodes
Latest Updated
6/19/2024
Github Stars
0.3K

How to Install Masquerade Nodes

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

Constant Mask Description

Create uniform mask with constant value for image processing and AI art tasks, offering flexibility and consistency in masking.

Constant Mask:

The Constant Mask node is designed to create a mask filled with a constant value, which can be particularly useful in various image processing and AI art tasks. This node allows you to generate a mask of a specified size or to match the size of an existing image, providing flexibility in its application. By setting a constant value across the entire mask, you can create uniform areas that can be used for masking, blending, or other operations in your workflow. This node is essential for tasks that require a consistent mask pattern, ensuring that the mask's value remains uniform across the entire area.

Constant Mask Input Parameters:

value

This parameter sets the constant value that will fill the entire mask. It is a floating-point number, allowing for precise control over the mask's intensity. The default value is 0.0, with a minimum of -8.0 and a maximum of 8.0. Adjusting this value will directly impact the mask's appearance, making it lighter or darker depending on the chosen value.

explicit_height

This parameter defines the height of the mask in pixels. It is an integer value, with a default of 0, which means that if no specific height is provided, a default small size will be used. The minimum value is 0, and the maximum is determined by the system's capabilities (VERY_BIG_SIZE). Setting this parameter allows you to control the vertical dimension of the mask explicitly.

explicit_width

This parameter specifies the width of the mask in pixels. Similar to explicit_height, it is an integer value with a default of 0. The minimum value is 0, and the maximum is determined by the system's capabilities (VERY_BIG_SIZE). This parameter lets you define the horizontal dimension of the mask explicitly.

copy_image_size (optional)

This optional parameter allows you to copy the size of an existing image to determine the mask's dimensions. If provided, the explicit_height and explicit_width parameters are ignored, and the mask will match the size of the given image. This is useful for ensuring that the mask aligns perfectly with an existing image, simplifying the workflow.

Constant Mask Output Parameters:

IMAGE

The output of the Constant Mask node is an image tensor filled with the specified constant value. This output can be used in subsequent nodes for various image processing tasks, such as masking, blending, or other operations that require a uniform mask. The dimensions of the output image are determined by the input parameters or the size of the provided image.

Constant Mask Usage Tips:

  • Use the value parameter to control the intensity of the mask, setting it to a higher value for a brighter mask or a lower value for a darker mask.
  • When working with existing images, use the copy_image_size parameter to ensure the mask matches the image dimensions, avoiding the need for manual size adjustments.
  • If you are unsure about the required mask size, set explicit_height and explicit_width to 0 to generate a small default mask that can be resized later in the workflow.

Constant Mask Common Errors and Solutions:

"Invalid value for explicit_height or explicit_width"

  • Explanation: The provided height or width is outside the acceptable range.
  • Solution: Ensure that the explicit_height and explicit_width parameters are within the valid range, with a minimum of 0 and a maximum determined by the system's capabilities.

"copy_image_size parameter is not an image"

  • Explanation: The copy_image_size parameter must be an image tensor.
  • Solution: Provide a valid image tensor for the copy_image_size parameter to ensure the mask dimensions match the image size.

"Value parameter out of range"

  • Explanation: The value parameter is set outside the allowed range of -8.0 to 8.0.
  • Solution: Adjust the value parameter to be within the specified range to ensure proper mask creation.

Constant Mask Related Nodes

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