ImageDrawPolygon
Draw a regular polygon — pentagons, hexagons, stars
- IMAGE
ImageDrawPolygon draws a regular polygon - equal sides, centered - on a transparent RGBA canvas. It's the one draw node that's a bit different from its siblings: instead of a bounding box, you pick a square canvas size, a side count, and a rotation, and it centers the shape for you. Pentagons, hexagons, octagons, or a triangle if you like - with an outline and a fill.
How it works
Same Allor draw pipeline (RGBA canvas, PIL drawing, supersample by SSAA, downscale with method), but here the shape comes from PIL's regular_polygon: a center point, a radius, sides, and rotation. The canvas is a square - there's a single size input, not width/height - and the polygon is always centered in it.
Inputs that matter:
- size - the square canvas's side length in pixels, default 256. Both dimensions are this value.
- sides - number of sides, minimum 3, default 5. 3 = triangle, 5 = pentagon, 6 = hexagon, and so on up to an approximation of a circle.
- rotation - rotation of the shape in degrees (0–360), default 0. At 0, a pentagon's first vertex points along the default orientation; rotate to put a flat side down if that's the look you want.
- outline_size - outline stroke width, default 1.
- outline_red / green / blue / alpha - outline color, default black.
- fill_red / green / blue / alpha - fill color, default white.
- SSAA (default 4) and method (default
lanczos).
The gotcha
Output is RGBA with a transparent background, like the whole draw family - the polygon floats on a checkerboard in Preview. That's the compositing-friendly behavior, but if you wanted a solid backdrop you'll composite onto a container yourself. There's no ByContainer variant for this node (the others have one), so if you need it at an image's exact size you'd create a container of that size, or just set size to match.
Why you'd use it
Badges, stop-sign overlays, shield shapes, honeycomb backgrounds, or any geometric graphic. Because the shape is regular and centered by construction, you don't have to fiddle with vertices - the side count and rotation are all you need.
Installing Allor
Part of the Allor Plugin (Nourepide/ComfyUI-Allor), ~90 nodes from early 2024:
cd ComfyUI/custom_nodes
git clone https://github.com/Nourepide/ComfyUI-Allor
cd ComfyUI-Allor
pip install -r requirements.txt
Restart, or search "Allor Plugin" in ComfyUI Manager - the more reliable route given the pack's history of manual-install import errors. Dependencies are rembg + onnx; drawing needs no models.
Gotchas that apply to the whole pack
The repo was rebased to strip images from history (shrank ~344×), so auto-update can occasionally break - the README's update-troubleshooting docs cover it; delete-and-reclone is the blunt fix. [Allor] console lines at startup are the pack writing config.json and checking updates, not an error.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| size | INT | 256 | — |
| sides | INT | 5 | — |
| rotation | INT | 0 | — |
| outline_size | INT | 1 | — |
| outline_red | INT | 0 | — |
| outline_green | INT | 0 | — |
| outline_blue | INT | 0 | — |
| outline_alpha | FLOAT | 1.00 | — |
| fill_red | INT | 255 | — |
| fill_green | INT | 255 | — |
| fill_blue | INT | 255 | — |
| fill_alpha | FLOAT | 1.00 | — |
| SSAA | INT | 41–16 | — |
| method | COMBO | 6 options: lanczos, bicubic, hamming, bilinear, box, nearest |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |