ComfyUI Node

Transform

Rotate, scale, and translate in one node — order matters

By isekai-sh·Created 9 months ago·Updated 8 months ago· 3
Transform
  • image
  • image
angle0.0
scale1.00
translate_x0
translate_y0

IsekaiTransform is the pack's "do three things at once" node: it rotates, scales, and translates an image in a single step, so you don't have to chain three separate nodes to get a skewed, repositioned, zoomed result. That's convenient when you're doing a quick composition tweak or building batch data-augmentation. The catch is that the order of operations is baked in, and it matters more than you'd think.

How it works. The node applies the transforms in a fixed sequence: scale first, then rotate, then translate. The scale uses scale as a multiplier (1.0 = unchanged, 2.0 = double, 0.5 = half) with Lanczos resampling. Rotation is by angle in degrees, counter-clockwise, with bicubic resampling and no canvas expansion - same behavior as the pack's Rotate node with expand off, meaning the corners of a rotated image get clipped. Translation comes last, pasting the result onto a black canvas at translate_x / translate_y (positive x = right, positive y = down), with any empty area filled black.

Why the order matters: because rotation happens before translation, the translation offsets are applied to the rotated coordinate space. And because scale comes first, a 2× scale followed by a 10px translate moves the scaled image 10px, not the original one. For simple compositions none of this bites you; for precise work, know that you can't reorder these within the node - if you need translate-then-rotate, chain the pack's individual Translate and Rotate nodes instead.

Inputs that matter. All four are optional, so this node can also act as a pass-through if you leave everything at defaults:

  • angle - −360 to 360, default 0. Rotation is the part that clips corners, remember.
  • scale - 0.01 to 10, default 1.0. Multiplier, not percentage - 2.0 is double, 1.5 is half-again.
  • translate_x / translate_y - integers from −8192 to 8192, default 0. Positive x is right, positive y is down; negatives move the image left/up.

Output is a single image (IMAGE tensor). Realistic uses: slapping a watermark or title card into a corner (scale to size, nudge with translate), or cheap data augmentation - small random rotations and translations are the classic LoRA-training move for stretching a small dataset, and one node keeps the graph tidy.

Install. Standard pack install: ComfyUI Manager → search "isekai" → install → restart. Or:

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

Restart; it's under Isekai → Image/Transform. Pure PIL, no models.

Common issues. Same house patterns: only the first image of a batch is processed (loop for batches), and on any error the node logs [Isekai] Transform Error to the console and returns the original image unchanged - a transform that "did nothing" is a silent failure. Two behavioral gotchas worth knowing before you fight them: rotation clips corners by design (no expand option here), and translation fills the exposed area with flat black, so translating a bright image down leaves a black band at the top that you may need to crop or fill. If you hit either, the individual Rotate (with expand) and Translate nodes in the same pack give you the knobs this combined node doesn't.

CategoryIsekai/Image/Transform

Inputs (5)

NameTypeDefaultDescription
imageIMAGE
angleoptFLOAT0.0-360–360
scaleoptFLOAT1.000.01–10
translate_xoptINT0-8192–8192
translate_yoptINT0-8192–8192

Outputs (1)

NameTypeDescription
imageIMAGE