Nodes/Dream Painter/⭮ Shape Rotate
ComfyUI Node

⭮ Shape Rotate

Spin a shape around its own center — the rotation that doesn't fight you

By alt-key-project·Created 2 years ago·Updated 2 years ago· 2
⭮ Shape Rotate
  • SHAPE
  • SHAPE
degrees

There are two kinds of rotation in vector-land: rotate around a point you pick, or rotate around the shape's own center. Shape Rotate [DPaint] is the second kind, and it's deliberately boring about it - you hand it any SHAPE and a number of degrees, and it spins the shape in place around its own center. No axis parameters, no anchor point to fumble, no mystery. That makes it the transform you'll reach for when a composition needs "the polygon, but tilted 15°," which turns out to be a huge fraction of the time you need rotation at all.

It's from the Dream Painter pack (alt-key-project/comfyui-dream-painter, MIT-licensed), the small kit for drawing simple 2D geometry that guides image generation - the README's honest framing is "quick-and-dirty, not intended to produce the final artwork." You're building the structure map, and rotation is how you stop your star or polygon from looking stiffly upright.

What it actually does

Under the hood it's a single call: copy the shape, compute its bounding-box center, and rotate every vertex around that center by the requested angle. Because the center is derived from the shape itself rather than supplied by you, a shape that sits at the corner of the frame rotates around its own corner-center - it won't swing around the canvas origin like it's on a tether. That's the behavior most people intuitively expect from "rotate," and it's why this node rarely surprises you.

The two inputs:

  • SHAPE - the shape to rotate, straight from any Dream Painter generator (polygon, star, rectangle, rays) or from another transform.
  • degrees - any value from -360 to 360, integer steps. Positive spins one way, negative the other; 360 puts you back where you started. There's no default, so the node will ask you to fill it in.

Output is a rotated SHAPE. You can keep it in the geometry world - resize it, combine it with other shapes via Shape Combiner [DPaint], render it with Draw Shape As Bitmap [DPaint] - or just preview it and wire the bitmap into a ControlNet as a structure condition.

Installing it

Same as every other Dream Painter node:

cd ComfyUI/custom_nodes
git clone https://github.com/alt-key-project/comfyui-dream-painter
cd comfyui-dream-painter
pip install -r requirements.txt

or search "Dream Painter" in ComfyUI Manager and restart. No models, no keys, no heavy deps - Pillow, scipy, numpy (pinned <2.0.0, the one real gotcha: pip may downgrade numpy 2 environments to satisfy that pin, and other packs can get testy).

Common gotchas

The one thing to remember: this rotates around the shape's center, not the canvas center. If your shape lives at the edge of the frame and you rotate it 90°, it stays at the edge - it doesn't swing across the image. If you wanted an orbit-style swing, rotate after centering with Shape Center & Fit [DPaint], or accept that the position won't change. Also, the input is degrees with no default - a freshly dragged-in node will sit there waiting for a number, which trips up people who expect 0. And as always with this pack: preview the rendered bitmap before it reaches a sampler; geometry this cheap invites experimentation.

Category🖌 DPaint/▢ shape

Inputs (2)

NameTypeDefaultDescription
SHAPESHAPE
degreesFLOAT-360–360

Outputs (1)

NameTypeDescription
SHAPESHAPE