Nodes/WhiteRabbit/🐇 Batch Resize w/ Lanczos
ComfyUI Node

🐇 Batch Resize w/ Lanczos

CUDA-accelerated, gamma-correct Lanczos resizer (TorchLanc). Modes: • Keep AR • Stretch • Crop (Cover + Crop) • Pad (Fit + Pad) • AR Scale + Divisible Crop Node functionality based on Resize nodes by Kijai More from me!: https://artificialsweetener.ai

By Artificial-Sweetener·Created 12 months ago·Updated 3 months ago· 75
🐇 Batch Resize w/ Lanczos
  • image
  • mask
  • IMAGE
  • width
  • height
  • mask
width1024
height576
resize_modeKeep AR
divisible_by1
max_batch_size0
sinc_window3
pad_color0, 0, 0
crop_positioncenter
precisionfp32
Categoryimage/resize

Inputs (11)

NameTypeDefaultDescription
imageIMAGEInput batch (B,H,W,C) in [0,1] float. Processed on GPU.
widthINT10241–16384Target width (pixels). Notes: • Keep AR / Pad: maximum width for the fit • Crop: final output width • AR Scale + Divisible Crop: requested width before divisibility
heightINT5761–16384Target height (pixels). Notes: • Keep AR / Pad: maximum height for the fit • Crop: final output height • AR Scale + Divisible Crop: requested height before divisibility
resize_modeCOMBOKeep ARModes: - Keep AR: Fit inside width×height (preserve aspect) - Stretch: Force to width×height (may distort) - Crop (Cover + Crop): Scale to cover, then crop to width×height - Pad (Fit + Pad): Fit inside, then pad to width×height - AR Scale + Divisible Crop: Scale by SOURCE long side to ≤ requested divisible; crop ONLY the short side to its divisible
divisible_byINT11–4096Force output dimensions to multiples of N. Details: • Keep AR: Fit → then step down to the largest size ≤ requested that keeps AR AND makes both sides divisible • AR Scale + Divisible Crop: Lock the scaled LONG side to its divisible target; crop ONLY the short side to its divisible Set to 1 (or 0 in UI) to disable
max_batch_sizeINT00–40960 = process whole batch >0 = chunk the batch to this size
sinc_windowINT31–8Lanczos window size (a). Higher = sharper (more ringing).
pad_colorSTRING0, 0, 0Pad mode only. RGB as 'r, g, b' (0-255).
crop_positionCOMBOcenterWhere to crop/pad from. Choose which edges are preserved for cropping, or where padding is added.
precisionCOMBOfp32Resampling compute dtype.
maskoptMASKOptional mask (B,H,W) in [0,1]. Resized with nearest. Follows the same crop/pad as the image.

Outputs (4)

NameTypeDescription
IMAGEIMAGE
widthINT
heightINT
maskMASK