Nodes/ComfyUI-YOLO/Image Resize Advanced
ComfyUI Node

Image Resize Advanced

A resize node that knows when not to resize

By kadirnar·Created 2 years ago·Updated 7 months ago· 121
Image Resize Advanced
  • image
  • IMAGE
  • width
  • height
width512
height512
interpolation
method
condition
multiple_of0

Most resize nodes in ComfyUI have one idea: make the image this size. This one has opinions - and it's a port of cubiq's ComfyUI_essentials resizer (the source says so), which means battle-tested code living in an unexpected neighborhood. It ships in a YOLO pack because detection workflows constantly need a resize before inference, but it's not YOLO-specific at all.

The inputs that matter: width/height (0–16384), method, condition, interpolation, and multiple_of. The two that make it better than a plain resize:

  • method - stretch (default, dumb), keep proportion (fit inside the box, letterbox-style), fill / crop (cover), and pad (fit with padding). Pick keep proportion and your subject stops looking like a funhouse mirror.
  • condition - always, downscale if bigger, upscale if smaller, if bigger area, if smaller area. This is the underrated one: tell it "only upscale if the image is smaller than target" and you never blow up a small input you didn't mean to touch.

interpolation offers the usual suspects plus lanczos for quality. multiple_of rounds the output dimensions to a multiple - set it to 8 or 32 and you get latent-friendly sizes without doing the arithmetic yourself.

It also returns width and height as INTs alongside the resized IMAGE, which is a small gift: wire those into nodes downstream that want to know the actual dimensions after conditional resizing (they'll differ from your inputs whenever condition said "leave it alone"). The mechanics are solid - the multiple-of rounding, the keep-proportion and pad math, and the condition checks all match ComfyUI_essentials' behavior.

Use cases: pre-resizing for YOLO inference at a sensible resolution, standardizing a batch of mixed-size images before a crop pipeline, or conditional downscales for VRAM relief. Note that when it does nothing (condition says skip), the returned width/height are the image's real dimensions, which is exactly what you want for honest downstream math.

Install is the pack's shared story: ComfyUI Manager (search "ComfyUI-YOLO"), or git clone https://github.com/kadirnar/ComfyUI-YOLO into custom_nodes, restart. Honestly, if all you need is this node, installing the whole pack is a heavy way to get it - but if you're already here for YOLO, it's the resize you'll want in front of the detector.

CategoryUltralytics/Utils

Inputs (7)

NameTypeDefaultDescription
imageIMAGE
widthINT5120–16384
heightINT5120–16384
interpolationCOMBO6 options: nearest, bilinear, bicubic, area, nearest-exact, lanczos
methodCOMBO4 options: stretch, keep proportion, fill / crop, pad
conditionCOMBO5 options: always, downscale if bigger, upscale if smaller, if bigger area, if smaller area
multiple_ofINT00–512

Outputs (3)

NameTypeDescription
IMAGEIMAGE
widthINT
heightINT