ComfyUI > Nodes > ComfyUI-YCNodes > Mask Split Filter

ComfyUI Node: Mask Split Filter

Class Name

MaskSplitFilter

Category
YCNode/Mask
Author
yichengup (Account age: 473days)
Extension
ComfyUI-YCNodes
Latest Updated
2025-06-03
Github Stars
0.02K

How to Install ComfyUI-YCNodes

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

Intelligently segments masks by analyzing patterns, separating connected regions for precise operations.

Mask Split Filter:

The MaskSplitFilter node is designed to intelligently segment masks by identifying and analyzing patterns within the mask data. This node is particularly useful for tasks that require precise separation of connected regions within a mask, leveraging techniques such as valley detection and pattern analysis. By focusing on the depth of valleys and the presence of specific patterns, the MaskSplitFilter can effectively split masks into distinct components, enhancing the accuracy and quality of mask-based operations. This capability is especially beneficial in scenarios where masks need to be divided into smaller, more manageable sections for further processing or analysis.

Mask Split Filter Input Parameters:

mask

The mask parameter is the primary input for the MaskSplitFilter node, representing the mask data that needs to be processed. This input is expected to be in a format that the node can interpret, typically a binary or grayscale image where different regions are represented by varying pixel values. The mask serves as the foundation for the node's operations, as it is the data that will be analyzed and potentially split into separate components.

valley_depth_threshold

The valley_depth_threshold parameter is a floating-point value that determines the sensitivity of the node to valleys within the mask. It ranges from 0.1 to 1.0, with a default value of 0.5. This threshold helps the node identify significant valleys that indicate potential split points. A lower threshold makes the node more sensitive to minor valleys, while a higher threshold focuses on more pronounced valleys, affecting the precision and granularity of the mask splitting.

pattern_check_range

The pattern_check_range parameter is an integer that specifies the range within which the node checks for patterns that may influence the splitting process. It ranges from 5 to 50, with a default value of 10. This parameter helps the node determine the extent of pattern analysis, impacting how it identifies and responds to recurring structures within the mask. A larger range allows for a broader analysis, potentially capturing more complex patterns.

cut_width

The cut_width parameter is an integer that defines the width of the cut applied to the mask when a split is determined. It ranges from 1 to 10, with a default value of 2. This parameter controls the size of the separation between split regions, influencing the final appearance and separation of the mask components. A wider cut width results in more distinct separation, while a narrower width maintains closer proximity between regions.

Mask Split Filter Output Parameters:

MASK

The output of the MaskSplitFilter node is a modified MASK, which represents the processed mask after the splitting operation. This output retains the same format as the input mask but reflects the changes made by the node's operations, such as the separation of connected regions based on the identified valleys and patterns. The output mask is crucial for subsequent processing steps, as it provides a refined and segmented version of the original mask, ready for further analysis or application.

Mask Split Filter Usage Tips:

  • Adjust the valley_depth_threshold to fine-tune the sensitivity of the node to different valley depths, which can help in achieving the desired level of mask separation.
  • Use the pattern_check_range to control the extent of pattern analysis, which can be particularly useful when dealing with masks that have complex or repetitive structures.
  • Experiment with different cut_width values to achieve the optimal balance between separation and connectivity of mask regions, depending on the specific requirements of your task.

Mask Split Filter Common Errors and Solutions:

"Input mask is not a valid format"

  • Explanation: This error occurs when the input mask is not in a format that the node can process, such as a non-binary image or an unsupported data type.
  • Solution: Ensure that the input mask is a binary or grayscale image and is provided in a compatible format, such as a NumPy array or a PyTorch tensor.

"No valleys detected with the current threshold"

  • Explanation: This error indicates that the node was unable to identify any valleys in the mask using the specified valley_depth_threshold.
  • Solution: Try lowering the valley_depth_threshold to make the node more sensitive to smaller valleys, or verify that the input mask contains features that can be interpreted as valleys.

"Pattern analysis range is too narrow"

  • Explanation: This error suggests that the pattern_check_range is set too low, limiting the node's ability to detect patterns effectively.
  • Solution: Increase the pattern_check_range to allow for a broader analysis of the mask, which can help in identifying more complex patterns that influence the splitting process.

Mask Split Filter Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-YCNodes
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 Playground, enabling artists to harness the latest AI tools to create incredible art.