Rotator
Spin an image around any point — affine rotation with a normal person's controls
- image
- IMAGE
Rotator is the pack's one standalone spatial node, and it's refreshingly conventional: rotate an image by some degrees around a center point you control. No formulas, no hidden params - four inputs and an IMAGE out. You feed it image, a rotation in degrees, and a center_x/center_y for the pivot, and you get a rotated image back.
The controls are the story here:
rotation- degrees, -360 to 360, default 45. Positive rotates clockwise in standard screen orientation. The range lets you do full turns, which reads oddly for stills but is exactly right if you're animating a full spin.center_x/center_y- the pivot point, normalized 0–1 across the image. Default 0.5/0.5 is dead center. (0, 0) is the top-left corner; (1, 1) is bottom-right. Being normalized instead of pixel-based is a small ergonomic win - it doesn't break when you change the image resolution.
How it works
Under the hood it's the classic affine rotation: the center is mapped from the 0–1 canvas to the -1–1 coordinate space, a 2×3 rotation matrix is built around it, and PyTorch's F.affine_grid + F.grid_sample does the resampling. Because it's a full resample rather than a pixel shuffle, edges get interpolated - smooth results, and the corners of the rotated image are filled from the nearest edge pixel (the sampler's border mode), not left black.
Where it fits
Inside this pack, Rotator pairs with the texture chain: rotate the UV map from UV Coordinate Generator before sampling, and the sampled texture appears to rotate. And unlike the CustomScript-NumPy route, the parameters are proper widgets - center_x/center_y as sliders, rotation in human-readable degrees - so it's the node you hand to someone who doesn't want to read NumPy.
Install
ComfyUI Manager → search "FuncAsTexture", or:
cd ComfyUI/custom_nodes
git clone https://github.com/CoiiChan/ComfyUI-FuncAsTexture-CoiiNode
# restart ComfyUI
No models, no requirements.txt. Category: FunctionAsTexture.
Gotchas
- The canvas doesn't grow. Rotating a 512×512 image by 45° gives you a 512×512 image with the content rotated and the corners filled in from the border. If you want a bigger canvas to fit the whole rotated image, resize (or pad) first.
- The center is normalized, the rotation is degrees. Two different units on the same node - the author deliberately skipped a "0–1 rotation" scheme because ComfyUI's 0.01 precision would make fine angles impossible. It's the right call, just note the asymmetry.
- Border fill, not transparency. The filled corners use the edge pixel, not alpha. If you need transparent corners you'll be masking the result.
It's the least "clever" node in the pack, which is its strength: rotation is a solved problem, and Rotator wraps it in controls a human being can set without a manual. If you're rotating images in ComfyUI and you've been doing it with ImageMagick calls in a subprocess - this is the node to replace that with.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| rotation | FLOAT | 45.00-360–360 | — |
| center_x | FLOAT | 0.500–1 | — |
| center_y | FLOAT | 0.500–1 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |