ComfyUI Node

Nuke Transform

Move, rotate, and scale images the Nuke way — no Nuke needed

By sumitchatterjee13·Created about a year ago·Updated 9 days ago· 59
Nuke Transform
  • image
  • IMAGE
translate_x0
translate_y0
rotate0.0
scale1.00
scale_x1.00
scale_y1.00
skew_x0.0
skew_y0.0
skew_orderXY
center_x-1
center_y-1
filtercubic
invertfalse

You generated the perfect subject and it's sitting three pixels off where it needs to be, or slightly too big, or crooked. You could re-roll the prompt and pray. Or you could just nudge it, the way every Nuke compositor does, and move on with your life. That's what NukeTransform is for: clean 2D repositioning, rotation, scaling, and skew of an image, matching the behavior of Nuke's Transform node.

It sits in the "comp cleanup" tier of a workflow - the part where you stop generating and start placing. Slide a render onto its background, rotate a tilted plate straight, scale a foreground element to match a layer behind it, or add a slow push-in to a video frames pass. Once you've used it, the amount of images you'll accept as "close enough" drops dramatically.

How it works

It builds a 2D affine transform matrix in Nuke's order - translate to the pivot, scale, skew, rotate, translate back - then resamples the image with PyTorch's grid_sample. Outside the image, output is transparent, not black, so the result drops cleanly onto whatever's behind it.

Two details worth knowing. Rotation is counter-clockwise in degrees, and translate_y follows Nuke's convention: a positive value moves the image up, even though image coordinates grow downward. And the pivot point matters: center_x / center_y default to -1, which means "use the image center." Set them to actual pixel coordinates and rotation/scale spin around that point instead - handy for orbiting an element around a hinge.

The inputs that matter

Most of the list is dead simple:

  • translate_x / translate_y - move in pixels (remember: positive Y is up)
  • rotate - degrees, counter-clockwise, −360 to 360
  • scale - uniform multiplier; 1.0 is original size
  • scale_x / scale_y - non-uniform stretch, multiplied with scale
  • skew_x / skew_y - shear in degrees, with skew_order (XY or YX) controlling the order
  • center_x / center_y - the pivot; -1 means image center
  • filter - resampling filter; see the gotcha below
  • invert - flips the whole transform, handy for un-doing one

The output is a single IMAGE at the same resolution as the input, transparent around the moved content. Wire it into a merge or straight into your save node.

The filter gotcha

Here's the trap, and it's in the source: filter offers eleven options - impulse, cubic, keys, simon, rifman, mitchell, parzen, notch, lanczos4, lanczos6, sinc4 - but the underlying grid_sample only actually does nearest and bilinear. Everything that isn't impulse (which maps to nearest) is currently sampled bilinearly. So the fancy Lanczos and Mitchell options don't give you the sharper results the names imply, at least not yet. Pick one and don't fight it; the practical difference on typical images is small.

Installing it

NukeTransform is part of the Nuke Nodes pack, so one install gets you all of these:

cd ComfyUI/custom_nodes
git clone https://github.com/sumitchatterjee13/nuke-nodes-comfyui.git nuke-nodes
cd nuke-nodes
pip install -r requirements.txt

Or search "Nuke Nodes" in ComfyUI Manager and restart. It appears under the Nuke category. The heavy dependency is OpenImageIO pulled in by requirements.txt - it's mostly used by the pack's Read/Write nodes, so if that install gives you trouble on your platform, the transform nodes themselves only really need the PyTorch that ComfyUI already ships.

Common issues

  • It moved the image off-canvas and it vanished - the content is there, just outside the frame. The node keeps the output canvas the same size as the input, so a big translate pushes pixels out of view. Nudge it back or merge onto a larger background.
  • Rotation is spinning around the wrong point - set center_x / center_y to your intended pivot instead of leaving them at the center default.
  • Edges look slightly soft after a big scale-up - that's bilinear resampling doing its thing; scale in smaller steps or accept it for comp work.
CategoryNuke/Transform

Inputs (14)

NameTypeDefaultDescription
imageIMAGE
translate_xFLOAT0-4096–4096
translate_yFLOAT0-4096–4096
rotateFLOAT0.0-360–360
scaleFLOAT1.000.001–10
scale_xFLOAT1.000.001–10
scale_yFLOAT1.000.001–10
skew_xFLOAT0.0-89–89
skew_yFLOAT0.0-89–89
skew_orderCOMBOXY2 options: XY, YX
center_xFLOAT-1-4096–8192
center_yFLOAT-1-4096–8192
filterCOMBOcubic4 options: impulse, cubic, lanczos, area
invertBOOLEANfalse

Outputs (1)

NameTypeDescription
IMAGEIMAGE