Nodes/ComfyUI-QING/图像旋转丨角度
ComfyUI Node

图像旋转丨角度

Image Rotation

By sheengoa·Created about a year ago·Updated 6 days ago· 16
图像旋转丨角度
  • image
  • image
  • mask
rotation_mode正向旋转
rotation_angle90
interpolationlanczos
enable_fillfalse
fill_color

Rotating an image sounds like a solved problem, and then you rotate a batch of 8 images and your pipeline breaks because the corners went diagonal. Image Rotation from WtlNodes is the node that thinks about what should happen to the canvas when you rotate, which is exactly the part core ComfyUI leaves to you.

You get a rotate value from −360 to 360 degrees and four fit_mode strategies for what to do with the rotated result:

  • crop - keep the original canvas size, rotate, and crop the corners. Sharpest look, loses content.
  • fit - rotate and shrink to fit inside the original bounds, so nothing is cropped but the whole image gets smaller (letterboxed with bg_color).
  • adjust - expand the canvas so the full rotated image fits at original scale. Nothing lost, but the output gets bigger.
  • none - just rotate and let the corners fall where they may, clipped and filled.

That's the whole puzzle, and having it as an explicit choice is the difference between "rotate" being a utility and being a workflow element.

The inputs that matter

  • rotate - degrees, default 0. 90, 180, 270 for the obvious ones; any float in between for straightening a tilted horizon.
  • fit_mode - covered above. Default is crop, which matches what most people expect from "rotate," but reach for adjust when you're rotating and then inpainting the corners.
  • interpolation - bilinear is the default and fine; lanczos is a touch crisper for large angles; nearest keeps hard-edged pixel art honest.
  • bg_color - black or white for the exposed edges.
  • apply_type - the pack's live-preview switch; none lets you scrub the angle with a live preview before committing.

Output is a single IMAGE at whatever size the fit mode dictates.

When you'd actually use it

Straightening batch renders, rotating 3D-render overlays to match a camera angle, correcting a generator's 90° misorientation, or pre-rotating a canvas so the sampler "sees" a portrait as landscape. Pair adjust + an img2img pass at low denoise and the model will happily fill the wedge-shaped corners - that's a legit way to re-frame a fixed-generation composition.

Install

Same pack, same drill:

cd ComfyUI/custom_nodes
git clone https://github.com/Scorpiosis0/ComfyUI-WtlNodes.git

Restart ComfyUI, or grab it via ComfyUI Manager (search "WtlNodes"). Nothing to download besides the repo.

Gotchas

  • crop isn't lossless. At 45° you're discarding a lot of frame. If content matters, use adjust and heal the corners, or fit if you need everything visible.
  • Repeated small rotations degrade quality. Every rotation resamples; a pipeline that rotates a few degrees at each of 20 steps will blur noticeably. Do one rotation, not twenty.
  • none is a trap for batch work - inconsistent canvas behavior across frames. If you're rotating a batch for a video, pick one fit mode and stick with it.
CategoryQING/图像处理

Inputs (6)

NameTypeDefaultDescription
imageIMAGE
rotation_modeCOMBO正向旋转2 options: 正向旋转, 反向旋转
rotation_angleINT900–360
interpolationCOMBOlanczos6 options: lanczos, bicubic, hamming, bilinear, box, nearest
enable_fillBOOLEANfalse
fill_colorCOMBO9 options: 黑, 白, 赤, 橙, 黄, 绿, +3

Outputs (2)

NameTypeDescription
imageIMAGE
maskMASK