ComfyUI > Nodes > ComfyUI-UniversalToolkit > Check Mask (UTK)

ComfyUI Node: Check Mask (UTK)

Class Name

CheckMask_UTK

Category
UniversalToolkit/Image
Author
whmc76 (Account age: 1110days)
Extension
ComfyUI-UniversalToolkit
Latest Updated
2026-03-16
Github Stars
0.07K

How to Install ComfyUI-UniversalToolkit

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

Check Mask (UTK) Description

Evaluates image masks by checking if a specified percentage of the mask area is white.

Check Mask (UTK):

The CheckMask_UTK node is designed to evaluate image masks by determining if a specified percentage of the mask area is white. This node is particularly useful in image processing tasks where masks are used to isolate or highlight specific regions of an image. By checking the proportion of the mask that is white, you can make informed decisions about whether the mask meets certain criteria for further processing or analysis. This functionality is essential for workflows that require precise control over masked areas, such as inpainting, segmentation, or compositing tasks. The node ensures that masks are appropriately sized and converted for evaluation, providing a reliable method to assess mask coverage.

Check Mask (UTK) Input Parameters:

mask

The mask parameter is the input image mask that you want to evaluate. It is crucial for this parameter to be a valid mask tensor, as the node will process this input to determine the white area percentage. If the mask is not provided or is invalid, the node will not be able to perform its function. The mask should ideally be a two-dimensional tensor, but if it is not, the node will attempt to adjust it accordingly. There are no specific minimum or maximum values for this parameter, but it must be a valid tensor representing an image mask.

white_point

The white_point parameter defines the threshold for what is considered "white" in the mask. This parameter is used to calculate the percentage of the mask area that is white. Adjusting this value can impact the node's sensitivity to different shades of white, allowing for more precise control over what is considered a white area in the mask. The exact range or default value for this parameter is not specified, but it should be set according to the desired sensitivity for white detection.

area_percent

The area_percent parameter specifies the minimum percentage of the mask area that must be white for the node to return a positive result. This parameter is crucial for determining whether the mask meets the required criteria for further processing. By setting this value, you can control the strictness of the mask evaluation, ensuring that only masks with sufficient white coverage are accepted. The parameter should be set as a percentage, with typical values ranging from 0 to 100.

Check Mask (UTK) Output Parameters:

ret

The ret output parameter is a boolean value that indicates whether the mask meets the specified white area percentage criteria. If the percentage of the white area in the mask exceeds the area_percent threshold, the node returns True; otherwise, it returns False. This output is essential for decision-making processes in workflows that rely on mask evaluation, allowing you to filter or select masks based on their coverage.

Check Mask (UTK) Usage Tips:

  • Ensure that the input mask is a valid tensor and properly formatted to avoid processing errors.
  • Adjust the white_point parameter to fine-tune the sensitivity of white detection in the mask, especially if working with masks that have varying shades of white.
  • Set the area_percent parameter according to the specific requirements of your task to ensure that only masks with adequate white coverage are accepted.

Check Mask (UTK) Common Errors and Solutions:

Check Mask (UTK): mask is None

  • Explanation: This error occurs when the input mask is not provided or is None.
  • Solution: Ensure that a valid mask tensor is passed to the node as input.

Check Mask (UTK): Failed to convert mask to PIL

  • Explanation: This error indicates that the mask could not be converted to a PIL image, possibly due to an invalid format.
  • Solution: Verify that the input mask is a valid tensor and correctly formatted for conversion to a PIL image.

Check Mask (UTK): Mask size exceeds limit

  • Explanation: The mask size exceeds the maximum allowed dimensions for processing.
  • Solution: Resize the mask to a smaller dimension before inputting it into the node, ensuring it does not exceed the size limit.

Check Mask (UTK) Related Nodes

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

Check Mask (UTK)