Visit ComfyUI Online for ready-to-use ComfyUI environment
Validate mask effectiveness based on white area criteria for image processing tasks, ensuring only significant masks are considered valid.
The LayerUtility: CheckMask node is designed to validate the effectiveness of a mask in image processing tasks. This node evaluates whether a given mask meets specific criteria based on the amount of white area it contains. If the mask's white area is below a certain threshold, it is deemed invalid. This functionality is particularly useful in scenarios where masks are used to isolate or highlight parts of an image, ensuring that only sufficiently significant masks are considered valid. By automating the validation process, this node helps streamline workflows and maintain consistency in image processing tasks.
The mask
parameter represents the input mask image that needs to be validated. This mask is typically a binary or grayscale image where certain areas are highlighted to indicate regions of interest. The node processes this mask to determine its validity based on the specified criteria.
The white_point
parameter is an integer value used to define the threshold for what is considered a "white" area in the mask. Any pixel value higher than this threshold is counted as part of the white area. The default value is 1, with a minimum of 1 and a maximum of 254. Adjusting this value allows you to fine-tune the sensitivity of the mask validation process.
The area_percent
parameter is an integer that specifies the minimum percentage of the mask that must be white for it to be considered valid. If the white area of the mask is below this percentage, the mask is deemed invalid. The default value is 1%, with a minimum of 1% and a maximum of 99%. This parameter helps ensure that only masks with a significant white area are accepted.
The bool
output parameter is a boolean value that indicates the validity of the mask. If the mask's white area exceeds the specified area_percent
, this parameter returns True
, indicating a valid mask. Otherwise, it returns False
, indicating an invalid mask. This output helps you quickly determine whether a mask meets the required criteria.
white_point
parameter based on the brightness levels of your mask images. Higher values may be necessary for masks with lighter shades of gray.area_percent
parameter to set a realistic threshold for mask validity based on the specific requirements of your project. For instance, if you need masks to cover at least half of the image, set this parameter to 50%.white_point
parameter is set outside the allowable range (1-254).white_point
value to be within the valid range. Ensure it is an integer between 1 and 254.area_percent
parameter is set outside the allowable range (1-99).area_percent
value to be within the valid range. Ensure it is an integer between 1 and 99.© Copyright 2024 RunComfy. All Rights Reserved.