- image
- image
- mask
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 withbg_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 iscrop, which matches what most people expect from "rotate," but reach foradjustwhen you're rotating and then inpainting the corners.interpolation-bilinearis the default and fine;lanczosis a touch crisper for large angles;nearestkeeps hard-edged pixel art honest.bg_color- black or white for the exposed edges.apply_type- the pack's live-preview switch;nonelets 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
cropisn't lossless. At 45° you're discarding a lot of frame. If content matters, useadjustand heal the corners, orfitif 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.
noneis 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.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| rotation_mode | COMBO | 正向旋转 | 2 options: 正向旋转, 反向旋转 |
| rotation_angle | INT | 900–360 | — |
| interpolation | COMBO | lanczos | 6 options: lanczos, bicubic, hamming, bilinear, box, nearest |
| enable_fill | BOOLEAN | false | — |
| fill_color | COMBO | 黑 | 9 options: 黑, 白, 赤, 橙, 黄, 绿, +3 |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| mask | MASK | — |