ComfyUI > Nodes > ComfyUI-Image-Effects > 🔷 Polygon

ComfyUI Node: 🔷 Polygon

Class Name

PolygonNode

Category
Image Effects
Author
orion4d (Account age: 929days)
Extension
ComfyUI-Image-Effects
Latest Updated
2025-05-28
Github Stars
0.02K

How to Install ComfyUI-Image-Effects

Install this extension via the ComfyUI Manager by searching for ComfyUI-Image-Effects
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-Image-Effects 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

🔷 Polygon Description

Transform images with polygonal shapes for a mosaic-like geometric effect, customizable in size, shape, and color.

🔷 Polygon:

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.

🔷 Polygon Input Parameters:

image

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.

polygon_sides

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.

polygon_size

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.

reduction_factor

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.

color_mode

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.

edge_preservation

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.

rotation

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.

outline

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.

🔷 Polygon Output Parameters:

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 Usage Tips:

  • Experiment with different polygon_sides and polygon_size settings to achieve various artistic effects, from simple geometric patterns to complex mosaics.
  • Use the 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.
  • Adjust the edge_preservation to balance between maintaining image details and achieving a smooth polygonal effect, depending on the desired outcome.

🔷 Polygon Common Errors and Solutions:

Image input not provided

  • Explanation: The node requires an image input to function, and this error occurs when no image is supplied.
  • Solution: Ensure that you provide a valid image as input to the node.

Invalid polygon_sides value

  • Explanation: The polygon_sides parameter must be between 3 and 12. An invalid value will cause this error.
  • Solution: Check and adjust the polygon_sides parameter to be within the specified range.

Invalid polygon_size value

  • Explanation: The polygon_size parameter must be between 10 and 100. An out-of-range value will trigger this error.
  • Solution: Verify and set the polygon_size parameter to a value within the allowed range.

🔷 Polygon Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-Image-Effects
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.