Nodes/comfyui-panels/Bevel Polygon
ComfyUI Node

Bevel Polygon

Round those harsh right-angle panel corners

By bmad4ever·Created 12 months ago·Updated 2 months ago· 41
Bevel Polygon
  • panel
  • POLYGON
curvature32
iterations4
buffer_res32

Real comic panels almost never have knife-sharp right-angle corners - that's a generated-image tell. Bevel Polygon is the node that fixes it: it takes a panel polygon and rounds the corners off, softening the harsh right angles into bevels so your page looks drawn rather than constructed. It's part of the pack's "polygon operations" family (Rotate, Scale, Translate, Skew, Offset, Bevel) that let you nudge panel shapes before they become masks or edge drawings.

You'll most often use it between Build Layout Panels and Panel to Mask: cut a clean grid, run each panel through a bevel with a small curvature, and suddenly the masks feeding your inpainting have organic corners. The README's example workflows (Polygon Operations, and the various preview workflows) show it in context.

How it works

The mechanism is shapely's buffer trick, applied repeatedly. Each iteration takes the polygon, buffers it outward by curvature pixels with a beveled join style, then buffers the result inward by the same amount. Buffering out-and-in smooths the corners while keeping the overall footprint roughly the same - a classic morphological smoothing. iterations controls how many times this runs; more passes means rounder, more thoroughly smoothed corners. There's a safety valve: if a pass would collapse the shape to empty or non-polygon territory, it keeps the last good polygon rather than erroring.

The inputs that matter

  • panel - the polygon to bevel.
  • curvature - default 32, range 1–256. Effectively the radius of the corner rounding in pixels. This is the dial you'll actually turn.
  • iterations - default 4, range 1–9. How many smoothing passes.
  • buffer_res - default 32, range 8–128. The resolution of the buffered curves; higher = smoother arcs at the cost of more vertices.

One POLYGON output.

Installing it

Part of comfyui-panels - Manager, search "comfyui-panels", or:

cd ComfyUI/custom_nodes
git clone https://github.com/bmad4ever/comfyui_panels

Restart, install deps (shapely, matplotlib, opencv-python), no models.

Where people get burned

Two things. First, because it uses an out-and-in buffer, a bevel also slightly shrinks the panel - with big curvature values on small panels, the shape can lose meaningful area, so compensate with a grow or offset if the panel ends up too small. Second, don't overdo iterations: past a point corners stop getting rounder and the polygon just accrues vertices, which makes every downstream mask slower. Default 4 is a sane place to stay.

CategoryBmad/Panels

Inputs (4)

NameTypeDefaultDescription
panelPOLYGON
curvatureINT321–256
iterationsINT41–9
buffer_resINT328–128

Outputs (1)

NameTypeDescription
POLYGONPOLYGON