Nodes/ComfyCollectorNodes/Rotate Image (CCN)
ComfyUI Node

Rotate Image (CCN)

Drag to rotate, get a mask for the filled corners

By valkymaera·Created 4 months ago·Updated 10 days ago· 1
Rotate Image (CCN)
  • image
  • image
  • mask
  • source_image
angle0.0
expandfalse
fill_color#000000
interpolation
pivot_x0.5000
pivot_y0.5000
loaded_image
debugfalse

Rotating an image sounds like a solved problem until you actually need it: a slight tilt to correct, or an artistic 12°, and suddenly you're juggling fill colors and the corners where the old frame shows through. Rotate Image (CCN) handles this the way you'd want it to - with an interactive canvas. Drag on the image in the node to rotate it visually (Shift snaps to 15°), drag the pivot point anywhere you like, and watch the result update live.

Two behaviors you choose with the expand toggle:

  • expand off - the output keeps the input's frame. The image rotates within it, corners crop, and any uncovered area gets painted with fill_color (default #000000).
  • expand on - the output grows to fit the rotated bounding box, so nothing crops, but the canvas changes size (and the pivot is ignored in this mode).

The outputs are where it gets interesting

Three outputs: image (the rotated result), mask (white exactly where the fill shows - the corners and uncovered strips), and source_image (the unrotated original, passed through untouched).

The mask output is the reason this node is more than a toy. Wire it into an inpaint pass and you can fill those black corners with generated content instead of leaving them a void - rotate, mask the fill areas, inpaint, done. The author explicitly built for that: the mask is white where the fill shows, including the bounding-box corners in expand mode.

The inputs that matter: angle (−360 to 360, 0.1 step), expand, fill_color (hex), interpolation (bilinear/nearest/bicubic), pivot_x/pivot_y (normalized 0–1, center by default), plus an optional wired image or a loaded_image file dropdown. Wired input wins over a loaded file, and the node's validation deliberately doesn't block a wired image if the loaded file has gone stale. Exact quarter-turns are bit-exact - no resampling drift at 90/180/270.

Install

Part of ComfyCollectorNodes, one install:

cd ComfyUI/custom_nodes
git clone https://github.com/valkymaera/ComfyCollectorNodes

then restart, or install via ComfyUI Manager ("ComfyCollectorNodes"). No models, no extra deps.

Where people get burned

The black corners. Default fill_color is pure black, which looks fine on a dark scene and glaringly wrong on a bright one - either change the hex or feed the mask into an inpaint. Also remember expand changes the output dimensions, which ripples into latent sizes downstream; if your sampler complains about size, that's usually the culprit. And if you wire in an image, the loaded-file dropdown is ignored - confusing for a second until you remember wired-wins is the rule.

CategoryComfyCollectorNodes/Image

Inputs (9)

NameTypeDefaultDescription
angleFLOAT0.0-360–360Rotation in degrees, positive = clockwise. Drag on the canvas to rotate; Shift snaps to 15°.
expandBOOLEANfalseOff: output keeps the input dimensions (corners crop, uncovered areas fill). On: output grows to the rotated bounding box; pivot has no effect.
fill_colorSTRING#000000Hex color painted where the rotated image no longer covers the frame.
interpolationCOMBO3 options: bilinear, nearest, bicubic
pivot_xFLOAT0.50000–1
pivot_yFLOAT0.50000–1
imageoptIMAGE
loaded_imageoptCOMBO2 options: none, example.png
debugoptBOOLEANfalse

Outputs (3)

NameTypeDescription
imageIMAGE
maskMASK
source_imageIMAGE