Visit ComfyUI Online for ready-to-use ComfyUI environment
Transform images with polygonal shapes for a mosaic-like geometric effect, customizable in size, shape, and color.
The PolygonNode is a versatile tool designed to transform images by overlaying polygonal shapes, offering a unique geometric effect. This node allows you to create a mosaic-like appearance by reducing image details into polygonal segments, which can be customized in terms of size, shape, and color. The primary goal of the PolygonNode is to provide a creative way to stylize images, making them appear as if they are composed of various polygons. This effect can be particularly useful for artistic purposes, where a more abstract or geometric representation of an image is desired. By adjusting parameters such as the number of sides of the polygons, their size, and the method of color selection, you can achieve a wide range of visual effects, from subtle to dramatic transformations.
The image
parameter is the input image that you want to transform using the polygonal effect. It serves as the base upon which the polygons will be applied, and its content will determine the overall appearance of the final output.
The polygon_sides
parameter specifies the number of sides for each polygon used in the transformation. It ranges from a minimum of 3 to a maximum of 12, with a default value of 6. This parameter directly affects the shape of the polygons, with fewer sides resulting in simpler shapes like triangles, and more sides creating complex shapes like dodecagons.
The polygon_size
parameter controls the size of the polygons applied to the image. It can be set between 10 and 100, with a default value of 30. Larger sizes will result in fewer, larger polygons covering the image, while smaller sizes will create a more detailed mosaic effect with more polygons.
The reduction_factor
parameter determines the degree of detail reduction in the image, ranging from 0.1 to 0.9, with a default of 0.5. A higher reduction factor will simplify the image more, resulting in a more abstract representation, while a lower factor will retain more of the original image details.
The color_mode
parameter offers three options: "average," "dominant," and "center," with "average" as the default. This parameter dictates how the color of each polygon is determined. "Average" calculates the mean color of the region, "dominant" selects the most frequent color, and "center" uses the color at the center of the polygon.
The edge_preservation
parameter, ranging from 0.0 to 1.0 with a default of 0.3, controls how much of the original image's edges are preserved in the transformation. Higher values will maintain more of the original edges, while lower values will result in a smoother, more blended effect.
The rotation
parameter allows you to rotate the polygons by a specified angle, ranging from 0.0 to 360.0 degrees, with a default of 0.0. This can add a dynamic and varied look to the image by altering the orientation of the polygons.
The outline
parameter is a boolean option that, when enabled, adds a black outline around each polygon. This can enhance the definition of the polygons and make them stand out more against the image.
The output is an IMAGE
that has been transformed by the polygonal effect. This image will display the original content reinterpreted through the geometric shapes, providing a stylized and artistic version of the input image. The output retains the same dimensions as the input image but with the applied polygonal transformation.
polygon_sides
and polygon_size
settings to achieve various artistic effects, from simple geometric patterns to complex mosaics.color_mode
parameter to explore different color interpretations, such as using the dominant color for a bold look or the average color for a more blended appearance.edge_preservation
to balance between maintaining image details and achieving a smooth polygonal effect, depending on the desired outcome.polygon_sides
parameter must be between 3 and 12. An invalid value will cause this error.polygon_sides
parameter to be within the specified range.polygon_size
parameter must be between 10 and 100. An out-of-range value will trigger this error.polygon_size
parameter to a value within the allowed range.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.