ComfyUI Node

Rotate

The tilt node with an expand button that decides everything

By isekai-sh·Created 9 months ago·Updated 8 months ago· 3
Rotate
  • image
  • image
angle0.0
expandfalse
resample

IsekaiRotate is the pack's tilt tool: spin an image by any angle, in pure PIL, in milliseconds. It sounds like the most boring node in the collection, and it mostly is - until you hit the expand toggle and realize it's the difference between "nice composition fix" and "all four corners clipped off like a bad crop."

How it works. It converts your image tensor to PIL and calls PIL's rotate with your angle (counter-clockwise, in degrees, −360 to 360 with 0.1 steps). The two knobs that actually change the result:

  • expand - the one that decides everything. With it off (the default), the canvas stays the original size and the corners of a rotated image simply get cut off; the image is also enlarged to avoid empty corners, so a 90° rotation of a non-square image gets squished rather than re-oriented. With expand on, the canvas grows to fit the whole rotated image, which means the output gets bigger and includes the full content. There's no way to get "full content at original size" - rotation math doesn't allow it - so pick the behavior you actually want.
  • resample - Nearest, Bilinear, or Bicubic. Bicubic gives the smoothest result for the sub-degree interpolation; Nearest is for hard-edged/pixel-art work where you don't want blurry new pixels.

Zero-angle rotations skip the work entirely and pass the image through. That matters more than it sounds: in a workflow where you expose angle as an input and sometimes set it to 0, you get the original pixels back with no resample artifacts.

Output is a single image (IMAGE tensor). The typical use is fixing a horizon, or batch-augmenting training data with small random rotations - a real trick for LoRA and dataset building, where rotating images 5–15 degrees cheaply fattens your dataset.

Install. Same as the whole pack: ComfyUI Manager → search "isekai" → install → restart. Or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/isekai-sh/isekai-comfy-node
cd isekai-comfy-node
pip install -r requirements.txt

Restart, find it under Isekai → Image/Transform. No models, no heavy deps - just Pillow.

Common issues. The pack-wide batch gotcha applies here: it only processes the first image of a batch and returns one image, so batch-augmentation needs a per-image loop or you'll rotate one image and drop the rest. And the house silent-failure pattern: any error logs [Isekai] Rotate Error to the console and returns the original image unchanged, so a rotation that "did nothing" is a node that threw, not a bug in your head. Beyond that, the real thing to internalize is expand: if you rotate a square image 30° with expand off, you've quietly cropped your corners, which is fine if you planned it and confusing if you didn't. Turn it on when you want the whole image back; turn it off when you want a filled frame with no empty triangles.

CategoryIsekai/Image/Transform

Inputs (4)

NameTypeDefaultDescription
imageIMAGE
angleFLOAT0.0-360–360
expandoptBOOLEANfalse
resampleoptCOMBO3 options: Nearest, Bilinear, Bicubic

Outputs (1)

NameTypeDescription
imageIMAGE