Nodes/comfyui-panels/Rotate Polygon
ComfyUI Node

Rotate Polygon

Spin a panel around any point you choose

By bmad4ever·Created 12 months ago·Updated 2 months ago· 41
Rotate Polygon
  • polygon
  • origin
  • POLYGON
angle0.00

Rotate Polygon is how you take a layout that's all right angles and give it some life. It rotates a single panel polygon by a given number of degrees, and the "around which point" control is where the node earns its keep - because where you rotate around changes the whole composition.

The mechanism is a direct wrapper around shapely's affine rotation, so it's exact geometry: the polygon's vertices move, the shape doesn't distort, and the result is still a clean polygon you can feed right back into the mask nodes or Paste Crops. No rasterization, no resampling, no quality loss - this is vector math.

The inputs that matter:

  • polygon - the panel to rotate.
  • angle - degrees, -360 to 360, default 0. Positive vs negative is just direction; in practice you'll set values like ±5 to ±25 for that slightly-angled, dynamic panel look that manga uses for action pages.
  • origin (optional) - a POLY_3O value controlling the pivot point. Leave it unconnected and the node rotates around the panel's center. That's usually what you want.

Where the origin options get fun: rotate around the centroid instead, and the pivot shifts slightly (center and centroid differ on lopsided panels). Rotate around a vertex and the panel swings like a door on a hinge - a great way to flare a panel outward from a page corner. Rotate around a vector point (an explicit x,y) and you can pivot around a spot that's not even on the panel. The origin nodes in this pack - Polygon Origin at Center, at Centroid, at Vertex, at Point - all feed this one input, and they're worth a minute of experimentation because they're the difference between a subtle tilt and a compositional statement.

The realistic workflow: after Build Layout Panels gives you the page structure, run each panel through Rotate (and its siblings Scale/Skew) to push the layout from "grid" toward "designed." Preview the result with Preview Panels before you commit to generating art, because a panel that tilts in geometry has to tilt in the mask and the final crop too - and all of that works because the polygon stays consistent through the chain.

One honest caution: rotating a panel inside a fixed page means it can poke outside the canvas or overlap its neighbors. The pack doesn't clip or resolve overlaps for you - that's your call, usually handled by eroding with Offset Polygon Bounds or accepting the overlap as a full-bleed panel. Which, in a comic, is often exactly what you wanted anyway.

Installing

Part of comfyui-panels by bmad4ever. Via ComfyUI Manager (search "comfyui-panels") and restart, or:

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

Deps: shapely, matplotlib, opencv-python - no models, no GPU. Shapely is pinned exactly; version clashes with other packs are the realistic import failure.

CategoryBmad/Panels

Inputs (3)

NameTypeDefaultDescription
polygonPOLYGON
angleFLOAT0.00-360–360
originoptPOLY_3OThe origin point used for the operation. If none provided, the 'center' option is used.

Outputs (1)

NameTypeDescription
POLYGONPOLYGON