Image Resize Advanced
A resize node that knows when not to resize
- image
- IMAGE
- width
- height
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), andpad(fit with padding). Pickkeep proportionand 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.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| width | INT | 5120–16384 | — |
| height | INT | 5120–16384 | — |
| interpolation | COMBO | 6 options: nearest, bilinear, bicubic, area, nearest-exact, lanczos | |
| method | COMBO | 4 options: stretch, keep proportion, fill / crop, pad | |
| condition | COMBO | 5 options: always, downscale if bigger, upscale if smaller, if bigger area, if smaller area | |
| multiple_of | INT | 00–512 | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| width | INT | — |
| height | INT | — |