ComfyUI > Nodes > Allor Plugin > ImageDrawPolygon

ComfyUI Node: ImageDrawPolygon

Class Name

ImageDrawPolygon

Category
image/draw
Author
Nourepide (Account age: 2900days)
Extension
Allor Plugin
Latest Updated
2024-05-22
Github Stars
0.2K

How to Install Allor Plugin

Install this extension via the ComfyUI Manager by searching for Allor Plugin
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter Allor Plugin 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
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

ImageDrawPolygon Description

Create and draw customizable regular polygons on image canvas with precise control over attributes for AI artists.

ImageDrawPolygon:

The ImageDrawPolygon node is designed to create and draw regular polygons on an image canvas. This node allows you to specify various attributes of the polygon, such as the number of sides, rotation, outline, and fill colors, as well as the size and anti-aliasing settings. By leveraging this node, you can generate complex geometric shapes with precise control over their appearance, making it a powerful tool for AI artists looking to incorporate polygonal designs into their artwork. The node's primary function is to facilitate the creation of visually appealing and customizable polygons, which can be seamlessly integrated into larger compositions or used as standalone elements.

ImageDrawPolygon Input Parameters:

size

This parameter defines the size of the canvas and the polygon. It determines the width and height of the canvas in pixels. The larger the size, the bigger the polygon will be. There is no strict minimum or maximum value, but typical values range from 100 to 1000 pixels.

sides

This parameter specifies the number of sides of the polygon. For example, a value of 3 will create a triangle, while a value of 6 will create a hexagon. The minimum value is 3, and there is no strict maximum value, but practical values usually range from 3 to 12.

rotation

This parameter sets the rotation angle of the polygon in degrees. It allows you to rotate the polygon around its center. The value can range from 0 to 360 degrees, with 0 being the default value, meaning no rotation.

outline_size

This parameter determines the thickness of the polygon's outline. A larger value will result in a thicker outline. The value is typically a positive integer, with common values ranging from 1 to 10 pixels.

outline_red

This parameter sets the red component of the outline color. The value ranges from 0 to 255, with 0 being no red and 255 being full red.

outline_green

This parameter sets the green component of the outline color. The value ranges from 0 to 255, with 0 being no green and 255 being full green.

outline_blue

This parameter sets the blue component of the outline color. The value ranges from 0 to 255, with 0 being no blue and 255 being full blue.

outline_alpha

This parameter sets the transparency of the outline. The value ranges from 0 to 1, with 0 being fully transparent and 1 being fully opaque.

fill_red

This parameter sets the red component of the fill color. The value ranges from 0 to 255, with 0 being no red and 255 being full red.

fill_green

This parameter sets the green component of the fill color. The value ranges from 0 to 255, with 0 being no green and 255 being full green.

fill_blue

This parameter sets the blue component of the fill color. The value ranges from 0 to 255, with 0 being no blue and 255 being full blue.

fill_alpha

This parameter sets the transparency of the fill. The value ranges from 0 to 1, with 0 being fully transparent and 1 being fully opaque.

SSAA

This parameter stands for Supersample Anti-Aliasing. It determines the level of anti-aliasing applied to the polygon to smooth out the edges. A higher value results in smoother edges but requires more processing power. Common values range from 1 to 4.

method

This parameter specifies the resampling method used when resizing the canvas back to its original size after applying SSAA. Common methods include "nearest", "bilinear", and "bicubic". The choice of method affects the quality and smoothness of the final image.

ImageDrawPolygon Output Parameters:

IMAGE

The output is an image tensor containing the drawn polygon. This tensor can be used in further image processing nodes or directly rendered as part of your artwork. The image will have the same dimensions as specified by the size parameter and will include the polygon with the specified attributes.

ImageDrawPolygon Usage Tips:

  • To create a smooth and visually appealing polygon, use a higher SSAA value, such as 2 or 4, to reduce jagged edges.
  • Experiment with different numbers of sides and rotation angles to create unique and interesting shapes.
  • Use contrasting colors for the outline and fill to make the polygon stand out in your composition.
  • Adjust the outline size to achieve the desired emphasis on the polygon's edges.

ImageDrawPolygon Common Errors and Solutions:

"Invalid size parameter"

  • Explanation: The size parameter must be a positive integer.
  • Solution: Ensure that the size parameter is set to a positive integer value.

"Invalid sides parameter"

  • Explanation: The sides parameter must be an integer greater than or equal to 3. - Solution: Set the sides parameter to an integer value of 3 or higher.

"Invalid color component value"

  • Explanation: Color component values (red, green, blue) must be integers between 0 and 255. - Solution: Check that all color component values are within the 0 to 255 range.

"Invalid alpha value"

  • Explanation: Alpha values must be between 0 and 1. - Solution: Ensure that the alpha values for both outline and fill are set within the 0 to 1 range.

"Unsupported resampling method"

  • Explanation: The specified resampling method is not recognized.
  • Solution: Use a valid resampling method such as "nearest", "bilinear", or "bicubic".

ImageDrawPolygon Related Nodes

Go back to the extension to check out more related nodes.
Allor Plugin
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.