Visit ComfyUI Online for ready-to-use ComfyUI environment
Perform morphological operations on image masks for refining and enhancing structures, removing noise, and filling gaps.
The Mask Morphology node is a powerful tool designed to perform various morphological operations on image masks. These operations include dilation, erosion, opening, and closing, which are essential for refining and manipulating masks in image processing tasks. By applying these operations, you can enhance the structure of masks, remove noise, and fill gaps, making them more suitable for subsequent processing steps. This node is particularly useful for AI artists who need to preprocess masks to achieve better results in their creative projects.
This parameter represents the input image mask that you want to process. The mask should be in the form of an image tensor. The quality and structure of the input mask will directly impact the results of the morphological operations.
The distance parameter controls the extent of the morphological operation. It determines how many pixels the operation will affect. The value can range from 0 to 128, with a default value of 5. A higher distance value will result in a more pronounced effect, while a lower value will have a subtler impact.
The op parameter specifies the type of morphological operation to be performed. The available options are "dilate", "erode", "open", and "close". Each operation serves a different purpose: "dilate" expands the mask, "erode" shrinks it, "open" removes small objects, and "close" fills small holes. Choose the operation that best suits your needs.
The output of the Mask Morphology node is an image tensor representing the processed mask. This output mask will have undergone the specified morphological operation, resulting in a refined and manipulated version of the input mask. You can use this output for further processing or directly in your creative projects.
© Copyright 2024 RunComfy. All Rights Reserved.