PVL Image Resize
The resize node that respects your latent's multiples
- image
- IMAGE
- width
- height
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.resizefits the image inside your target box (keeping aspect ratio, possibly smaller on one axis);padandpad_edgecenter it and fill the leftover with color (or edge pixels);cropfills the box and cuts off the overflow;stretchjust 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, so255, 255, 255, 0gives 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.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 5120–8192 | — |
| height | INT | 5120–8192 | — |
| upscale_method | COMBO | 5 options: nearest-exact, bilinear, area, bicubic, lanczos | |
| keep_proportion | COMBO | resize | 5 options: stretch, resize, pad, pad_edge, crop |
| pad_color | STRING | 0, 0, 0 | Color to use for padding (RGB or RGBA). Example: '255, 255, 255, 0' for transparent white. |
| crop_position | COMBO | center | 5 options: center, top, bottom, left, right |
| divisible_by | INT | 20–512 | — |
| downsize_only | BOOLEAN | false | Only resize if target dimensions are smaller than original. |
| imageopt | IMAGE | — | |
| deviceopt | COMBO | cpu | 2 options: cpu, gpu |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| width | INT | — |
| height | INT | — |