Nodes/ComfyUI-Artha-Nodes/πŸ”± Artha Image Transform
ComfyUI Node

πŸ”± Artha Image Transform

Resize, crop, pad, rotate and flip in one node

By CyrostarΒ·Created 10 months agoΒ·Updated 8 months agoΒ· 0
πŸ”± Artha Image Transform
  • image
  • mask
  • image
  • mask
  • width
  • height
β—„resize_modenoneβ–Ί
β—„upscale_methodlanczosβ–Ί
β—„target_width512β–Ί
β—„target_height512β–Ί
β—„keep_proportionstrueβ–Ί
β—„rotation0β–Ί
β—„custom_angle0.0β–Ί
β—„flip_horizontalfalseβ–Ί
β—„flip_verticalfalseβ–Ί
β—„normalizetrueβ–Ί
β—„auto_orientfalseβ–Ί

Artha Image Transform is the πŸ”± Artha pack's geometry node: one input, eleven knobs, and it handles resize, crop, pad, rotation, and flips in a single place. If you've ever chain-built resize β†’ rotate β†’ flip with three separate nodes just to get a training-batch image ready, this collapses that whole stack.

The honest headline: you can do all of this with ComfyUI's core nodes, which is exactly why most people won't reach for this one by default. Where it earns its place is in an Artha-only pipeline, and in the way it reports back real width/height outputs - a small thing that saves wiring through a separate image-size node when you need dimensions downstream.

How it works

The node does its work in order: rotation first (using rotation or custom_angle), then flips (flip_horizontal/flip_vertical), then resizing per the resize_mode. The resize_mode dropdown is where the real behavior lives:

  • none - no size change; rotation/flip only.
  • resize - scale to target_width/target_height, with keep_proportions deciding whether to stretch or preserve aspect.
  • crop - resize to cover the target dimensions, then center-crop to fit exactly.
  • pad - resize to fit inside the target, then pad with the edge color to reach the full size.

The upscale_method (nearest, bilinear, bicubic, area, lanczos) picks the resampling filter; lanczos is the quality default. normalize controls whether the output tensor's pixel values get normalized, and auto_orient applies EXIF orientation correction. An optional mask input rides along and is passed through, and you get the mask back as an output too - handy when you resize a mask together with its image.

Inputs that matter

  • image - required IMAGE input. mask - optional MASK, passed through unchanged.
  • resize_mode - the mode that decides everything about sizing.
  • target_width / target_height - 64–4096, step 8 (multiples of 8, which keeps things diffusion-friendly).
  • keep_proportions - on by default; turn off only if you want a deliberate stretch.
  • rotation - 0/90/180/270 or custom, which unlocks custom_angle (βˆ’360Β° to 360Β°).

Outputs: image (IMAGE), mask (MASK), width (INT), height (INT) - the last two report the actual resulting dimensions.

Installing it

One-pack install, same as all Artha nodes:

cd ComfyUI/custom_nodes
git clone https://github.com/Cyrostar/ComfyUI-Artha-Nodes
pip install -r ComfyUI/custom_nodes/ComfyUI-Artha-Nodes/requirements.txt

then restart ComfyUI, or install "ComfyUI-Artha-Nodes" via ComfyUI Manager. The heavy lifting here is opencv-python from the pack requirements (used for the geometry ops) plus the standard stack. No API key, no model files - fully local.

Common issues

  • Stretched/distorted output: keep_proportions is off, or you're mixing resize with mismatched target dims. Turn it back on.
  • Content cut off unexpectedly: that's crop mode doing exactly what it says - it crops to the aspect. Use pad if you'd rather letterbox than lose pixels.
  • Rotation at odd angles adds border: custom rotation with expand=True rotates the canvas, so the image gets letterboxed. Expected behavior, just don't be surprised by the bars.
  • Pillow vs OpenCV quirk: the node mixes both libraries internally; if a transform behaves oddly on a very large image, downscale upstream first.

The verdict: a competent all-in-one geometry node that's most valuable inside an Artha-native workflow or when you want dimensions handed back for free. Outside that, the core ImageScale/ImageFlip nodes cover you - but there's nothing wrong with reaching for this one first.

CategoryArtha/Image

Inputs (13)

NameTypeDefaultDescription
imageIMAGEβ€”
resize_modeCOMBOnone4 options: none, resize, crop, pad
upscale_methodCOMBOlanczos5 options: nearest, bilinear, bicubic, area, lanczos
target_widthINT51264–4096β€”
target_heightINT51264–4096β€”
keep_proportionsBOOLEANtrueβ€”
rotationCOMBO05 options: 0, 90, 180, 270, custom
custom_angleFLOAT0.0-360–360β€”
flip_horizontalBOOLEANfalseβ€”
flip_verticalBOOLEANfalseβ€”
normalizeBOOLEANtrueβ€”
auto_orientBOOLEANfalseβ€”
maskoptMASKβ€”

Outputs (4)

NameTypeDescription
imageIMAGEβ€”
maskMASKβ€”
widthINTβ€”
heightINTβ€”