ComfyUI > Nodes > ComfyUI 1hewNodes > Mask Alpha Clean

ComfyUI Node: Mask Alpha Clean

Class Name

1hew_MaskAlphaClean

Category
1hewNodes/mask
Author
1hew (Account age: 1113days)
Extension
ComfyUI 1hewNodes
Latest Updated
2026-04-17
Github Stars
0.03K

How to Install ComfyUI 1hewNodes

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

Refines alpha masks by removing noise and artifacts, enhancing image compositing precision.

Mask Alpha Clean:

The 1hew_MaskAlphaClean node is designed to refine and enhance alpha masks by cleaning up unwanted noise and small artifacts, which are often present in image processing tasks. This node is particularly useful for AI artists who work with image compositing and need to ensure that their masks are clean and precise. By applying a series of thresholding and noise detection techniques, the node effectively removes small, isolated components (often referred to as "islands") that do not contribute to the overall mask structure. This cleaning process helps in achieving smoother transitions and more accurate mask boundaries, which are crucial for high-quality image blending and compositing. The node offers different levels of cleaning strength, allowing you to choose the appropriate balance between preserving details and removing noise, thus providing flexibility based on the specific requirements of your project.

Mask Alpha Clean Input Parameters:

mask

The mask parameter is the primary input for the node, representing the alpha mask that you wish to clean. It should be a tensor, typically in a 2D or 3D format, where the values indicate the transparency levels of the corresponding pixels in the image. The node processes each channel of the mask independently, ensuring that the cleaning operations are applied consistently across the entire mask.

clean_strength

The clean_strength parameter determines the intensity of the cleaning process applied to the mask. It offers three options: "soft," "balanced," and "strong." The "soft" setting applies minimal cleaning, preserving most of the mask's original details, while the "strong" setting aggressively removes noise and small artifacts, potentially at the cost of some finer details. The "balanced" option provides a middle ground, offering a good compromise between detail preservation and noise removal. The default value is "balanced."

detect_only

The detect_only parameter is a boolean flag that, when set to True, instructs the node to only detect and highlight noise within the mask without actually removing it. This can be useful for diagnostic purposes, allowing you to visualize areas of the mask that would be affected by the cleaning process. When set to False, the node performs the full cleaning operation, removing the detected noise from the mask. The default value is False.

Mask Alpha Clean Output Parameters:

mask

The mask output is the cleaned version of the input mask, with noise and small artifacts removed according to the specified cleaning strength. This output is a refined alpha mask that can be used for further image processing tasks, ensuring smoother and more accurate compositing results.

noise_mask

The noise_mask output provides a visualization of the noise and small components that were detected and potentially removed from the original mask. This output is useful for understanding the impact of the cleaning process and for verifying that the desired level of detail has been preserved in the cleaned mask.

Mask Alpha Clean Usage Tips:

  • Use the "soft" clean strength setting when you want to preserve as much detail as possible in the mask, especially when working with intricate designs or textures.
  • Opt for the "strong" clean strength setting when dealing with masks that have a lot of noise or small, unwanted artifacts, ensuring a cleaner and more defined output.
  • Utilize the detect_only mode to preview the areas of the mask that will be affected by the cleaning process, allowing you to make informed decisions about the appropriate cleaning strength to use.

Mask Alpha Clean Common Errors and Solutions:

"Input mask is not a tensor"

  • Explanation: This error occurs when the input provided to the node is not a tensor, which is the expected data type for the mask parameter.
  • Solution: Ensure that the input mask is correctly formatted as a tensor before passing it to the node. You may need to convert your data to a tensor format using appropriate libraries or functions.

"Mask dimensions are incorrect"

  • Explanation: This error indicates that the input mask does not have the expected dimensions, which should be either 2D or 3D.
  • Solution: Check the dimensions of your input mask and adjust them if necessary. The mask should be a 2D or 3D tensor, with the third dimension representing different channels if applicable.

Mask Alpha Clean Related Nodes

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

Mask Alpha Clean