ComfyUI > Nodes > ComfyUI_KimNodes > 🍒Mask_White_Area_Ratio📊蒙版白色区域占比

ComfyUI Node: 🍒Mask_White_Area_Ratio📊蒙版白色区域占比

Class Name

Mask_White_Area_Ratio

Category
🍒 Kim-Nodes/🔲Mask_Tools | 蒙板工具
Author
Kim (Account age: 2536days)
Extension
ComfyUI_KimNodes
Latest Updated
2025-09-22
Github Stars
0.05K

How to Install ComfyUI_KimNodes

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

🍒Mask_White_Area_Ratio📊蒙版白色区域占比 Description

Calculates the white area ratio in a mask to assess if it exceeds a specified threshold.

🍒Mask_White_Area_Ratio📊蒙版白色区域占比:

The Mask_White_Area_Ratio node is designed to analyze a given mask and calculate the proportion of white areas within it. This node is particularly useful for determining whether the white area in a mask exceeds a specified threshold, which can be crucial for tasks that require precise control over mask coverage, such as image processing or AI art generation. By converting the mask into a numerical format, the node evaluates the ratio of white pixels to the total number of pixels, providing a percentage that represents the white area coverage. This functionality allows you to make informed decisions based on the extent of the white area, enabling more refined control over your creative processes.

🍒Mask_White_Area_Ratio📊蒙版白色区域占比 Input Parameters:

mask

The mask parameter is the input mask that you want to analyze. It is expected to be in a format that the node can process, typically a tensor or array representing the mask image. The mask serves as the basis for calculating the white area ratio, and its quality and resolution can impact the accuracy of the results.

area_threshold

The area_threshold parameter is a floating-point value that sets the percentage threshold for the white area ratio. It determines whether the calculated white area ratio is considered significant. The default value is 50.0, with a minimum of 0.0 and a maximum of 100.0. Adjusting this threshold allows you to define what constitutes an acceptable level of white area coverage for your specific application.

custom_white_level

The custom_white_level parameter is a hidden floating-point value that specifies the threshold for determining what is considered "white" in the mask. The default value is 0.5, with a range from 0.0 to 1.0. This parameter allows you to customize the sensitivity of the white area detection, which can be useful if your mask has varying shades of white or if you need to adjust for different lighting conditions.

🍒Mask_White_Area_Ratio📊蒙版白色区域占比 Output Parameters:

white_area_ratio

The white_area_ratio output is a floating-point value that represents the proportion of white pixels in the mask relative to the total number of pixels. This ratio is expressed as a percentage, providing a clear indication of how much of the mask is covered by white areas. This output is crucial for understanding the extent of white coverage in your mask and can be used to make decisions based on this metric.

boolean

The boolean output is a boolean value that indicates whether the white area ratio exceeds the specified area_threshold. If the ratio is greater than the threshold, the output will be True; otherwise, it will be False. This output provides a straightforward way to determine if the white area coverage meets your predefined criteria, enabling automated decision-making in your workflows.

🍒Mask_White_Area_Ratio📊蒙版白色区域占比 Usage Tips:

  • Adjust the area_threshold parameter to fine-tune the sensitivity of the node to different levels of white area coverage, depending on the specific requirements of your project.
  • Use the custom_white_level parameter to account for variations in mask brightness or contrast, ensuring that the node accurately identifies white areas under different conditions.

🍒Mask_White_Area_Ratio📊蒙版白色区域占比 Common Errors and Solutions:

"Invalid mask format"

  • Explanation: This error occurs when the input mask is not in a compatible format for processing.
  • Solution: Ensure that the mask is provided as a tensor or array that the node can interpret. Check the input data type and structure.

"Threshold value out of range"

  • Explanation: This error indicates that the area_threshold or custom_white_level values are outside their allowable ranges.
  • Solution: Verify that the area_threshold is between 0.0 and 100.0, and the custom_white_level is between 0.0 and 1.0. Adjust the values accordingly.

🍒Mask_White_Area_Ratio📊蒙版白色区域占比 Related Nodes

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