ComfyUI > Nodes > ComfyUI_KimNodes > 🍒Mask_Noise_Cleaner🧹蒙版噪点清理器

ComfyUI Node: 🍒Mask_Noise_Cleaner🧹蒙版噪点清理器

Class Name

Mask_Noise_Cleaner

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_Noise_Cleaner🧹蒙版噪点清理器 Description

Refines mask images by removing noise and preserving the largest connected white regions.

🍒Mask_Noise_Cleaner🧹蒙版噪点清理器:

The Mask_Noise_Cleaner node is designed to refine and enhance mask images by removing unwanted noise and retaining the most significant connected white regions. This node is particularly useful in scenarios where you need to clean up a mask by eliminating small, isolated white areas that are not part of the main subject. By focusing on the largest connected white region, the node ensures that the primary subject of the mask is preserved while extraneous noise is removed. This process is crucial for improving the quality and accuracy of masks used in various image processing tasks, such as segmentation or inpainting, where precise mask boundaries are essential.

🍒Mask_Noise_Cleaner🧹蒙版噪点清理器 Input Parameters:

mask

The mask parameter is the input mask image that you want to clean. It should be a 2D tensor representing the mask, where the white areas indicate the regions of interest. This parameter is crucial as it serves as the base for the noise cleaning process. The node will process this mask to identify and retain the most significant connected white region while removing smaller, irrelevant areas.

仅保留最大连通区域

This boolean parameter, translated as "Retain Only the Largest Connected Region," determines whether the node should only keep the largest connected white area in the mask. When set to True, the node will discard all other smaller white regions, ensuring that only the primary subject is retained. This is particularly useful when you want to focus on the main object in the mask without any distractions. The default value is True.

保留面积阈值

The 保留面积阈值 parameter, meaning "Area Retention Threshold," is an integer that specifies the minimum area size for white regions to be retained in the mask. If 仅保留最大连通区域 is set to False, this threshold becomes active, allowing you to keep all white regions that meet or exceed this specified area size. This parameter provides flexibility in controlling the level of detail retained in the mask. The default value is 100, with a minimum of 0 and a maximum of 100000.

🍒Mask_Noise_Cleaner🧹蒙版噪点清理器 Output Parameters:

清理后的遮罩

The 清理后的遮罩, or "Cleaned Mask," is the output mask tensor that results from the noise cleaning process. This mask retains only the significant white regions as specified by the input parameters, providing a refined version of the original mask. It is crucial for applications that require precise mask boundaries, as it eliminates unwanted noise and focuses on the main subject.

遮罩图像

The 遮罩图像, or "Mask Image," is a 3-channel image representation of the cleaned mask. This output is useful for visualization purposes, allowing you to see the results of the noise cleaning process in a format that is easy to interpret. It provides a clear view of the retained regions and can be used for further processing or analysis.

🍒Mask_Noise_Cleaner🧹蒙版噪点清理器 Usage Tips:

  • To focus solely on the main subject of your mask, set 仅保留最大连通区域 to True. This will ensure that only the largest connected white region is retained, removing all smaller areas.
  • If you need to retain multiple significant regions, set 仅保留最大连通区域 to False and adjust the 保留面积阈值 to a suitable value that captures the desired level of detail.
  • Use the 遮罩图像 output to visually inspect the results of the cleaning process and ensure that the desired regions have been retained.

🍒Mask_Noise_Cleaner🧹蒙版噪点清理器 Common Errors and Solutions:

No contours found

  • Explanation: This error occurs when the input mask does not contain any detectable white regions, resulting in no contours being found during processing.
  • Solution: Ensure that the input mask contains distinct white regions. You may need to adjust the mask generation process to create more defined areas of interest.

Invalid mask shape

  • Explanation: This error arises when the input mask is not a 2D tensor, which is required for processing.
  • Solution: Verify that the input mask is a 2D tensor. If it is a multi-dimensional array, use the squeeze function to reduce it to two dimensions before inputting it into the node.

🍒Mask_Noise_Cleaner🧹蒙版噪点清理器 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.