ComfyUI > Nodes > ComfyUI-YCNodes > Mask Smart Valley Split

ComfyUI Node: Mask Smart Valley Split

Class Name

MaskSmartValleySplit

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 Smart Valley Split Description

Automated mask segmentation based on valleys and patterns for precise region separation in AI art creation.

Mask Smart Valley Split:

The MaskSmartValleySplit node is designed to intelligently segment masks by detecting valleys and analyzing patterns within the mask data. This node is particularly useful for AI artists who need to refine and separate regions within a mask based on specific depth and pattern criteria. By leveraging valley detection and pattern analysis, the node can identify and split areas of interest, ensuring that the mask is divided into meaningful segments. This process enhances the precision of mask-based operations, allowing for more detailed and accurate artistic creations. The node's primary goal is to automate the segmentation process, reducing manual intervention and improving the efficiency of mask manipulation tasks.

Mask Smart Valley Split Input Parameters:

mask

The mask parameter is the primary input for the node, representing the binary mask that needs to be processed. This mask is a two-dimensional array where the node will perform its valley detection and pattern analysis to determine the appropriate split points. The mask should be in a format that the node can interpret as a binary image, where non-zero values indicate the presence of a region of interest.

valley_depth_threshold

The valley_depth_threshold parameter is a floating-point value that determines the sensitivity of the valley detection process. It defines the minimum depth a valley must have to be considered significant for segmentation. The default value is 0.5, with a range from 0.1 to 1.0, allowing you to adjust the threshold based on the desired level of detail in the segmentation. A lower threshold may result in more valleys being detected, while a higher threshold will focus on deeper valleys.

pattern_check_range

The pattern_check_range parameter is an integer that specifies the range over which the node will analyze patterns within the detected valleys. This range helps in identifying consistent trends or features that indicate a suitable split point. The default value is 10, with a range from 5 to 50, providing flexibility in how detailed the pattern analysis should be. A larger range may capture broader patterns, while a smaller range focuses on more localized features.

cut_width

The cut_width parameter is an integer that defines the width of the cut to be made in the mask at the identified split point. This width determines how much of the mask will be removed to create a clear separation between regions. The default value is 2, with a range from 1 to 10, allowing you to control the extent of the separation. A wider cut may result in more distinct regions, while a narrower cut maintains more of the original mask.

Mask Smart Valley Split Output Parameters:

MASK

The output of the MaskSmartValleySplit node is a modified MASK, which is the result of the intelligent segmentation process. This output mask reflects the changes made by the node, where valleys have been detected and split according to the specified parameters. The output is a binary mask that maintains the same dimensionality as the input, ensuring compatibility with subsequent processing steps. This segmented mask can be used for further artistic manipulation or analysis, providing a refined and precise representation of the original input.

Mask Smart Valley Split Usage Tips:

  • Adjust the valley_depth_threshold to fine-tune the sensitivity of valley detection. Lower values will detect more subtle valleys, which can be useful for intricate designs.
  • Use the pattern_check_range to control the granularity of pattern analysis. A larger range can help in identifying broader trends, which is beneficial for complex masks with multiple features.
  • Experiment with the cut_width to achieve the desired level of separation between regions. A wider cut can create more distinct segments, which may be necessary for certain artistic effects.

Mask Smart Valley Split Common Errors and Solutions:

"Mask is not a binary image"

  • Explanation: This error occurs when the input mask is not in a binary format, meaning it contains values other than 0 and 1. - Solution: Ensure that the input mask is properly binarized before passing it to the node. You can use image processing tools to convert the mask to a binary format.

"No valleys detected"

  • Explanation: This error indicates that the node was unable to find any valleys that meet the specified depth threshold.
  • Solution: Try lowering the valley_depth_threshold to make the detection process more sensitive, or verify that the input mask has regions that can form valleys.

"Invalid pattern check range"

  • Explanation: This error suggests that the pattern_check_range is set outside the acceptable limits or is not suitable for the mask's dimensions.
  • Solution: Adjust the pattern_check_range to fall within the specified range of 5 to 50, and ensure it is appropriate for the size of the mask being analyzed.

Mask Smart Valley Split 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.