Image Resize To π¦βπ₯
Size your images by the long edge, not the square
- image
- IMAGE
- prev_width
- prev_height
- log
Most resizing nodes in ComfyUI make you pick a fixed width and height, which means you're deciding the aspect ratio too - often by accident, and always by squishing. This node takes the opposite approach: you tell it a target scale tier or two edge sizes, and it computes the other dimension automatically so the proportion is preserved. It's the "resize to 1080p" node, not the "resize to 1920Γ1080 even if that distorts" node.
How the presets work
The target_size dropdown offers 720P, 1080P, 2K, 4K, or custom. The presets aren't random - they're built around a 16:9 reference (720Γ1280, then scaled Γ1.5, Γ2, Γ3), but the node then fits your image's own aspect ratio inside that box: whichever edge is longer drives the scale, and the short edge follows. A square image resized to "1080P" gets 1920Γ1920-ish behavior via the long-edge rule, not a forced 16:9 crop. That's the "proportion is kept by default" promise in the description.
Choose custom and the bbox_edge1 / bbox_edge2 inputs wake up - you specify two edge sizes (16β8192) and the orientation is picked automatically, with the same fit-inside-bounding-box logic. You don't have to say "which is the long edge"; it figures that out.
The other inputs that matter
upscale_method: lanczos / nearest-exact / bilinear / area / bicubic. For upscaling, lanczos is the sharp default;areais notably good when downscaling. This is the same family of choices the core ComfyUI upscale nodes offer, because it calls ComfyUI's owncommon_upscaleunder the hood.onlyEnlarge(default true): the safety toggle. On (default), images larger than the target are left untouched - it will only ever upscale, never downscale. Turn it off if you genuinely want everything forced to the target size. This is the input that stops a batch job from shrinking your 4K masters by accident.
Outputs
Four of them, and the last two are the sleeper features: IMAGE (resized), prev_width / prev_height (the original dimensions, useful for logging or for a later restore), and log (a STRING that tells you whether it resized or skipped, and from what to what). In a batch pipeline, feeding that log into a print/save node gives you a free run log of what each image became.
Install
ComfyUI Manager β search ComfyUI-ArchiGraph, or:
cd ComfyUI/custom_nodes
git clone https://github.com/vincentfs/ComfyUI-ArchiGraph
Restart and run the pack's install script once. This node is pure torch/ComfyUI utilities - no OpenCV needed.
Gotchas
- Presets are 16:9-referenced. If you feed it an extreme panorama, "720P" won't give you a "720p video" frame - it gives a 720-long-edge image with your own ratio. Read it as a scale tier, not a literal resolution.
onlyEnlargedefaults on. If your resizes "aren't working," that's usually why - the image was already bigger than the target.- It upscales via
common_upscale, which is a one-shot resample, not an AI upscaler. It'll make images bigger; it won't invent detail. For that you'd chain a real upscale model - this node is the geometry step.
The resize node you want when "keep my aspect ratio, make it 2K" is the whole requirement. Set the tier, leave onlyEnlarge on, done.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | β | |
| target_size | COMBO | 720P | Preset target sizes. Select 'custom' to specify edge size manually. |
| bbox_edge1 | INT | 102416β8192 | Only valid for custom target type. Edge size for the boundingbox. Orientation will be calculated automatically. |
| bbox_edge2 | INT | 102416β8192 | Only valid for custom target type. Edge size for the boundingbox. Orientation will be calculated automatically. |
| upscale_method | COMBO | 5 options: lanczos, nearest-exact, bilinear, area, bicubic | |
| onlyEnlarge | BOOLEAN | true | If true, only enlarge images. Large images will be kept at original size. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | β |
| prev_width | INT | β |
| prev_height | INT | β |
| log | STRING | β |