LayerUtility: LayerImageTransform
LayerImageTransform — move, scale, rotate and mirror an image on its own canvas
- image
- image
Sometimes you just need to nudge, resize, spin, or flip an image before it goes anywhere else. That's this node. It takes one image and applies a transform - offset, scale, aspect ratio, rotation, mirror - and gives you back the transformed image on the same-sized canvas. No compositing, no blending, just the geometry.
Where it fits: prep a layer before an ImageBlend, straighten or re-frame a plate, mirror a reference, scale something down to sit inside a larger scene. It's the "move tool" half of a composite when you want that step isolated and reusable rather than buried inside a blend node.
How it works
It resamples your image through the transform you specify and paints the result onto a canvas the same dimensions as the input. Everything that moves past the canvas edge gets clipped - this isn't an "expand the frame" node, it's "reposition within the frame." The resampling filter you pick decides how clean the scaled/rotated result looks.
The inputs and outputs that matter
x/y- pixel offset. Positive moves right/down. This is your reposition.scale(default 1) andaspect_ratio(default 1) - resize.scaleis uniform;aspect_ratiosquashes or stretches one axis.rotate- degrees. Full float precision, so you can straighten by 0.5° if you need to.mirror-None,horizontal, orvertical. The flip.transform_method- the resampling filter:lanczosandbicubicfor smooth photographic results,nearestfor pixel-art or hard edges, plushamming,bilinear,box.anti_aliasing(default 2) - smooths edges after rotation/scaling; raise it if diagonals look stair-stepped.
Output: a single transformed image.
How to install it
Comes with the LayerStyle pack. ComfyUI Manager → search LayerStyle → install → restart. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/chflame163/ComfyUI_LayerStyle
pip install -r ComfyUI_LayerStyle/requirements.txt
then restart. Look under 😺dzNodes → LayerUtility. It's a lightweight node, no model download.
Common issues & troubleshooting
Content gets cut off after moving or scaling up. The canvas doesn't grow. Anything shifted or enlarged past the original frame is clipped. If you need the moved layer to keep its full extent, do the placement inside ImageBlendAdvance instead, which composites onto a larger background.
Scaled result looks soft or jagged. That's transform_method and anti_aliasing. Use lanczos for downscaling photos, and raise anti_aliasing if rotated edges are rough. Only use nearest when you actually want crisp pixels.
Rotation leaves empty corners. Expected - rotating a rectangle inside a same-size frame exposes the corners. Composite the result over a background afterward, or rotate before you crop.
The node isn't in the menu. The whole pack failed to import - LayerStyle's usual failure is a broken transformers dependency (a stray TensorFlow is the common one) taking every node down at once. Read the traceback, hit "Try Fix" in Manager, or repair the offending library.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| x | INT | 0-99999–99999 | — |
| y | INT | 0-99999–99999 | — |
| mirror | COMBO | 3 options: None, horizontal, vertical | |
| scale | FLOAT | 1.000.01–100 | — |
| aspect_ratio | FLOAT | 1.000.01–100 | — |
| rotate | FLOAT | 0.00-999999–999999 | — |
| transform_method | COMBO | 6 options: lanczos, bicubic, hamming, bilinear, box, nearest | |
| anti_aliasing | INT | 20–16 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |