Visit ComfyUI Online for ready-to-use ComfyUI environment
Manipulate masks with morphological operations for precise shape adjustments and effects in AI workflows.
The MaskMorph node is designed to manipulate masks through various morphological operations, providing you with the ability to refine and adjust mask shapes dynamically. This node is particularly useful for tasks that require precise control over the mask's structure, such as enhancing or reducing specific areas, smoothing edges, or filling gaps. By applying operations like erosion, dilation, opening, and closing, MaskMorph allows you to achieve a wide range of effects, from subtle adjustments to significant transformations. This flexibility makes it an essential tool for AI artists looking to fine-tune their mask-based workflows.
This parameter determines the type of morphological operation to be applied to the mask. The available options are erode
, dilate
, open
, and close
. Each operation has a distinct effect: erode
shrinks the mask, dilate
expands it, open
removes small objects, and close
fills small holes. Choosing the appropriate operation is crucial for achieving the desired mask transformation.
This integer parameter sets the maximum size of the kernel used in the morphological operation. The kernel size influences the extent of the transformation, with larger kernels producing more pronounced effects. The value ranges from 3 to 21, with a default of 5. Adjusting this parameter allows you to control the scale of the operation, making it either more subtle or more aggressive.
This integer parameter defines the maximum number of iterations the morphological operation will be applied. More iterations result in a stronger effect. The value ranges from 1 to 50, with a default of 10. By tuning this parameter, you can control the intensity of the transformation, ensuring it meets your specific needs.
This parameter is a float that scales the kernel size and the number of iterations based on its value. It allows for fine-tuning the overall impact of the morphological operation. A higher strength value increases both the kernel size and the number of iterations, amplifying the effect of the chosen operation.
The output of the MaskMorph node is a transformed mask that has undergone the specified morphological operation. This output mask reflects the adjustments made based on the input parameters, providing a refined version that can be used in subsequent processing steps. The transformed mask can help enhance the quality and precision of your AI-generated artwork.
morph_type
options to understand their effects and choose the one that best suits your needs.max_kernel_size
and max_iterations
and gradually adjust them to see how they impact the mask transformation.strength
parameter to fine-tune the overall effect, especially when you need subtle adjustments.<morph_type>
morph_type
is provided.morph_type
parameter is set to one of the following valid options: erode
, dilate
, open
, or close
.max_kernel_size
parameter is set to an invalid value.max_kernel_size
is an odd number within the range of 3 to 21.max_iterations
parameter is set to an invalid value.max_iterations
parameter is set to a value within the range of 1 to 50.© Copyright 2024 RunComfy. All Rights Reserved.