Visit ComfyUI Online for ready-to-use ComfyUI environment
Perform various morphological transformations on images for image processing and computer vision, enhancing, cleaning, and extracting features.
The MorphologicOperation node is designed to perform a variety of morphological transformations on images, which are essential techniques in image processing and computer vision. These operations can help you enhance, clean, or extract specific features from your images, making them more suitable for further analysis or artistic manipulation. The node supports a range of operations such as erosion, dilation, opening, closing, gradient, top hat, and bottom hat, each serving a unique purpose in modifying the structure of the image. By applying these operations, you can achieve effects like noise reduction, object separation, and edge detection, which are crucial for creating high-quality AI-generated art.
This parameter represents the source image that you want to process. It should be an image file that you wish to apply the morphological operations to.
This parameter specifies the type of morphological operation to be applied to the image. The available options are MORPH_ERODE
, MORPH_DILATE
, MORPH_OPEN
, MORPH_CLOSE
, MORPH_GRADIENT
, MORPH_TOPHAT
, and MORPH_BLACKHAT
. The default value is MORPH_ERODE
. Each operation has a different effect on the image, such as shrinking or expanding objects, removing noise, or highlighting edges.
This parameter defines the shape of the structuring element (kernel) used in the morphological operation. The available options are MORPH_RECT
, MORPH_ELLIPSE
, and MORPH_CROSS
. The default value is MORPH_RECT
. The choice of kernel shape can influence the outcome of the operation, affecting how the image is processed.
This parameter sets the width of the kernel. It is an integer value with a default of 4, a minimum of 2, and increments in steps of 2. The size of the kernel determines the extent of the morphological operation, with larger kernels having a more pronounced effect.
This parameter sets the height of the kernel. It is an integer value with a default of 4, a minimum of 2, and increments in steps of 2. Similar to kernel_size_x
, the height of the kernel affects the scope of the operation.
This parameter specifies the number of times the morphological operation is applied to the image. It is an integer value with a default of 1 and increments in steps of 1. Increasing the number of iterations can enhance the effect of the operation, making it more noticeable.
The output is the processed image after the specified morphological operation has been applied. This image will reflect the changes made based on the chosen operation, kernel type, kernel size, and number of iterations. The result can be used for further processing or as a final output for your artistic projects.
operation
types to see how each one affects your image. For example, use MORPH_GRADIENT
to highlight edges or MORPH_CLOSE
to fill small holes in objects.kernel_size_x
and kernel_size_y
parameters to control the extent of the morphological operation. Larger kernels will have a more significant impact on the image.iterations
parameter to fine-tune the effect. More iterations can enhance the operation's impact, but be cautious as too many iterations might distort the image.<operation>
for morphology. Must be one of 'erode', 'dilate', 'open', 'close', 'gradient', 'tophat', 'bottomhat'operation
parameter is set to one of the valid options: MORPH_ERODE
, MORPH_DILATE
, MORPH_OPEN
, MORPH_CLOSE
, MORPH_GRADIENT
, MORPH_TOPHAT
, or MORPH_BLACKHAT
.kernel_size_x
or kernel_size_y
are set to non-positive values.kernel_size_x
and kernel_size_y
are set to positive integers, with a minimum value of 2.src
is not provided or is in an unsupported format.src
parameter is set to a valid image file in a supported format.© Copyright 2024 RunComfy. All Rights Reserved.