Nodes/ComfyUI Assistant Node/PVL Image Resize
ComfyUI Node

PVL Image Resize

The resize node that respects your latent's multiples

By pvlprk·Created about a year ago·Updated 8 months ago· 1
PVL Image Resize
  • image
  • IMAGE
  • width
  • height
width512
height512
upscale_method
keep_proportionresize
pad_color0, 0, 0
crop_positioncenter
divisible_by2
downsize_onlyfalse
devicecpu

Resizing an image in ComfyUI sounds trivial until you actually need to do it properly. Core has an ImageScale, sure, but it'll happily hand a sampler a 733x511 image, and the sampler will hand you back garbage because the latent isn't a clean multiple. PVL Image Resize is the version that actually thinks about that. It's the one I reach for when an image needs to land on a specific size and stay divisible by 8 (or 64, or whatever the model wants).

It's part of the pvlprk/comfyui-pvl-api-nodes pack ("ComfyUI Assistant Node") - a big grab-bag of utilities and cloud-API nodes. This one is a genuinely useful utility with a lot of knobs.

What it actually does

It's built on ComfyUI's own common_upscale, so the resampling itself is the standard, well-tested machinery. The value is everything wrapped around it:

  • keep_proportion - the mode that sets this node apart. resize fits the image inside your target box (keeping aspect ratio, possibly smaller on one axis); pad and pad_edge center it and fill the leftover with color (or edge pixels); crop fills the box and cuts off the overflow; stretch just distorts to fit.
  • divisible_by - floors the output dimensions down to a multiple of this. Default 2; set it to 8 or 64 before feeding a VAE and you'll dodge most "size not supported" errors at the sampler.
  • downsize_only - only shrinks. Handy for a guard: feed an upscale chain and never risk it blowing past the target.
  • upscale_method - nearest-exact, bilinear, area, bicubic, lanczos. Bicubic is the sane default; lanczos if you want the sharpest.
  • pad_color - an RGB or RGBA string, so 255, 255, 255, 0 gives you transparent padding. Nice when you're compositing.
  • crop_position - where to anchor the crop (center, top, bottom, left, right). Matters when faces would get cut.

Inputs worth knowing about: image (optional, IMAGE), plus device (cpu/gpu) if you want the work off the CPU. Outputs are the resized IMAGE and the actual width/height it landed on - wiring those back into the graph is a nice trick when downstream nodes need to match the real size.

One genuine trap: on gpu, lanczos is not supported and the node throws. If you switch devices and hit a hard error, that's why.

Installing

cd ComfyUI/custom_nodes
git clone https://github.com/pvlprk/comfyui-pvl-api-nodes

restart, or grab it via ComfyUI Manager by searching for "ComfyUI Assistant Node". No model files, and this node only needs torch and numpy, which ComfyUI already ships. The pack's requirements.txt installs a lot of unrelated stuff (OpenAI, Google, fal clients) for its other nodes - harmless, just don't panic at the install log.

Where you'll actually use it

The classic workflow: generate at one size, upscale with a detailer, then normalize every result to a clean multiple before a final pass or before stitching images into a batch. Set divisible_by: 8, keep_proportion: resize, and stop thinking about it. Compared to hand-rolling core nodes, this collapses three or four steps into one and gives you the real output size for free.

CategoryPVL_tools

Inputs (10)

NameTypeDefaultDescription
widthINT5120–8192
heightINT5120–8192
upscale_methodCOMBO5 options: nearest-exact, bilinear, area, bicubic, lanczos
keep_proportionCOMBOresize5 options: stretch, resize, pad, pad_edge, crop
pad_colorSTRING0, 0, 0Color to use for padding (RGB or RGBA). Example: '255, 255, 255, 0' for transparent white.
crop_positionCOMBOcenter5 options: center, top, bottom, left, right
divisible_byINT20–512
downsize_onlyBOOLEANfalseOnly resize if target dimensions are smaller than original.
imageoptIMAGE
deviceoptCOMBOcpu2 options: cpu, gpu

Outputs (3)

NameTypeDescription
IMAGEIMAGE
widthINT
heightINT