ComfyUI > Nodes > ComfyUI-YCNodes > Irregular To EllipseMask

ComfyUI Node: Irregular To EllipseMask

Class Name

IrregularToEllipseMask

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

Irregular To EllipseMask Description

Transform irregular masks into elliptical shapes for standardization and simplification in image processing tasks.

Irregular To EllipseMask:

The IrregularToEllipseMask node is designed to transform irregularly shaped masks, which may include concave regions, into more regular elliptical masks. This node is particularly useful for AI artists who need to standardize mask shapes for consistent processing or aesthetic purposes. By converting complex shapes into ellipses, the node simplifies the mask structure, making it easier to handle in subsequent image processing tasks. The node offers flexibility in how the conversion is performed, allowing for options such as smoothing edges, filling holes, and expanding or contracting the mask. This ensures that the resulting mask can be tailored to specific artistic needs, providing a balance between maintaining the original shape's integrity and achieving a more uniform appearance.

Irregular To EllipseMask Input Parameters:

mask

The mask parameter is the primary input for the node, representing the irregular mask that you wish to convert into an ellipse. This parameter is essential as it defines the initial shape that will undergo transformation. The mask should be provided in a format compatible with the node's processing capabilities, typically as a binary or grayscale image where the mask is defined.

keep_region

The keep_region parameter determines which part of the mask should be prioritized during the conversion process. Options include "all," "largest," "top," "bottom," "left," and "right," with the default being "largest." This parameter allows you to focus on specific regions of interest within the mask, ensuring that the most relevant areas are preserved in the final elliptical shape.

fill_holes

The fill_holes parameter controls whether holes within the mask should be filled before conversion. It can be set to "enable" or "disable," with "enable" as the default. Filling holes can be beneficial for creating a more solid and continuous mask, which is often desirable when aiming for a smooth elliptical shape.

smooth_edges

The smooth_edges parameter allows you to enable or disable edge smoothing, with the default set to "enable." Smoothing the edges of the mask can help in achieving a cleaner and more visually appealing ellipse by reducing jaggedness and irregularities along the mask's boundary.

smoothing_kernel_size

The smoothing_kernel_size parameter specifies the size of the kernel used for edge smoothing, with a default value of 5. It accepts integer values ranging from 3 to 31, in steps of 2. A larger kernel size results in more pronounced smoothing, which can be useful for masks with highly irregular edges.

output_mode

The output_mode parameter defines the method used to generate the final mask. Options include "ellipse," "convex_hull," and "filled_original," with "ellipse" as the default. This parameter allows you to choose between different approaches for mask conversion, depending on the desired outcome and the characteristics of the original mask.

expand_mask

The expand_mask parameter controls the expansion or contraction of the mask, with a default value of 0. It accepts integer values from -100 to 100, where positive values expand the mask and negative values contract it. This parameter provides additional control over the size of the resulting mask, allowing for fine-tuning to match specific requirements.

blur_amount

The blur_amount parameter determines the amount of Gaussian blur applied to the mask, with a default value of 0.0. It accepts floating-point values from 0.0 to 100.0, in steps of 0.1. Applying blur can help in further smoothing the mask and reducing noise, resulting in a more polished final output.

Irregular To EllipseMask Output Parameters:

ellipse_mask

The ellipse_mask is the output of the node, representing the transformed mask in an elliptical shape. This output is crucial for subsequent processing steps, as it provides a standardized and simplified version of the original mask. The ellipse mask retains the essential features of the input while offering a more uniform and aesthetically pleasing shape, suitable for various artistic and technical applications.

Irregular To EllipseMask Usage Tips:

  • To achieve a smoother ellipse, consider enabling smooth_edges and adjusting the smoothing_kernel_size to a higher value.
  • Use the expand_mask parameter to fine-tune the size of the ellipse, especially if the original mask is too small or too large for your needs.
  • Experiment with the output_mode to see which method best suits your artistic vision, whether it's a perfect ellipse, a convex hull, or a filled original shape.

Irregular To EllipseMask Common Errors and Solutions:

Error: "Invalid mask input"

  • Explanation: This error occurs when the input mask is not in the expected format or is corrupted.
  • Solution: Ensure that the mask is a valid binary or grayscale image and is properly formatted before inputting it into the node.

Error: "Smoothing kernel size out of range"

  • Explanation: The specified smoothing_kernel_size is outside the allowed range of 3 to 31. - Solution: Adjust the smoothing_kernel_size to be within the specified range, ensuring it is an odd integer.

Error: "Blur amount too high"

  • Explanation: The blur_amount exceeds the maximum allowable value.
  • Solution: Reduce the blur_amount to a value within the 0.0 to 100.0 range to prevent excessive blurring.

Irregular To EllipseMask 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.