Nodes/Link Comfy Nodes/Rotate Image
ComfyUI Node

Rotate Image

Batch-rotate frames with a real background fill

By Mister-Link·Created 9 months ago·Updated 24 days ago· 0
Rotate Image
  • images
  • rotated_image
degrees0
background_color#000000

Rotating an image by an arbitrary angle - not a clean 90/180/270 - always leaves corners exposed, since the rotated content no longer fills a rectangular canvas. Rotate Image handles that directly: rotate a batch of frames by any degree, and fill whatever gets exposed with a background color you choose, rather than leaving transparency or black by default without any control over it.

How it works

It applies the same rotation to every frame in your batch, at whatever angle you set, and fills the newly-exposed corner regions with a solid color. It's a straightforward geometric transform, but having batch support and a controllable fill color built in is what makes it worth reaching for over a generic single-image rotate node - useful if you're correcting a slight camera tilt across a whole clip, or deliberately rotating stylized frames as an effect.

The inputs and outputs that matter

  • images (IMAGE, required) - the batch to rotate.
  • degrees (INT, default 0, range -360 to 360) - the rotation angle. Negative values rotate the opposite direction; the full ±360 range means you can dial past a full turn if that's useful for your setup, though anything beyond ±180 is equivalent to the smaller angle in the other direction.
  • background_color (STRING, default "#000000") - the fill color for the corners the rotation exposes.

One output: rotated_image (IMAGE) - the rotated batch, ready to feed downstream.

How to install it

Through ComfyUI Manager: search "Link Comfy Nodes," install, restart. Manual route:

cd ComfyUI/custom_nodes
git clone https://github.com/Mister-Link/link-comfy-nodes
pip install -r link-comfy-nodes/requirements.txt

Restart ComfyUI when finished.

Common issues & troubleshooting

Visible solid-color corners you didn't want. That's background_color doing its job - at any angle that isn't a clean multiple of 90°, corners will be exposed by simple geometry, there's no way around it with a single rotation. If a flat color reads as jarring, consider a downstream crop that trims into the rotated frame past where the exposed corners are, rather than trying to disguise the fill color.

Wanting the color to auto-match rather than being a fixed value. This node doesn't sample your image to pick a fill color for you - background_color is a static value you set. Pair it with Find Furthest Color or Convert Color Format elsewhere in this pack if you want a computed color instead of hand-picking one, particularly across a batch where a single hardcoded color might not suit every frame.

Small rotations look like nothing happened. At small angles (a few degrees, for a stabilization-style correction) the exposed corner area is tiny and easy to miss at a glance - zoom in on the actual corners of the output if you're trying to confirm the rotation applied rather than judging by the overall silhouette.

Categoryimage/transform

Inputs (3)

NameTypeDefaultDescription
imagesIMAGE
degreesINT0-360–360
background_colorSTRING#000000

Outputs (1)

NameTypeDescription
rotated_imageIMAGE