Image_Resize_longsize
Resize by the long edge, keep the aspect ratio
- image
- IMAGE
Most resize nodes make you specify a target width and a target height, which is annoying when what you actually care about is "make the longer side X pixels, whatever the aspect ratio is." Image_Resize_longsize does exactly that one job: give it an image and a target size, and it scales the image so the longer of its two dimensions - width or height, whichever is bigger - lands exactly on that number, with the shorter side scaled proportionally to keep the aspect ratio intact. A 1920×1080 image resized to size: 1024 comes out at 1024×576; a portrait 1080×1920 comes out at 576×1024. No cropping, no distortion.
The only other control is interpolation_mode - five options: nearest-exact, bilinear (the default), area, bicubic, and lanczos. If you're not sure which to pick: bilinear is a safe, fast default for most photographic content; lanczos tends to look sharper on detailed images but costs a bit more compute; area is generally the better choice specifically when you're shrinking an image a lot, since it averages pixels rather than sampling between them. nearest-exact is really for pixel art or masks where you don't want any blending at all.
Why this matters more than it looks like it should. A lot of image-editing and vision-language models are sensitive to the exact resolution you feed them, and not in a subtle way. Qwen-Image-Edit is a well-documented example: users reported edits coming back geometrically offset - proportions skewed, framing shifted - and the fix the community converged on was controlling the input resolution before it ever reaches the model, the same trick Flux Kontext needed for the same class of problem. A long-edge resize like this one is a natural pre-processing step for exactly that situation: normalize your reference image to a sane long-edge size before it hits an edit or vision-language model, rather than feeding it whatever raw resolution came out of your camera or a random web image. It's also the same idea behind vl_size on this pack's own Easy_QwenEdit2509 node, which resizes reference images to a fixed working size (384px by default) before the vision-language encoder looks at them - this node is the general-purpose version of that same instinct, usable anywhere you need it, not just inside that one specific node.
Outputs. A single IMAGE, resized and ready for whatever's next - a VAE encode, a vision-language conditioning node, an upscaler, or just a save.
Installing it. Standard for the whole pack - search "ComfyUI-Apt_Preset" in ComfyUI Manager, or clone it directly:
cd ComfyUI/custom_nodes
git clone https://github.com/cardenluo/ComfyUI-Apt_Preset.git
Run install.bat on Windows for dependencies, then restart ComfyUI. This node is pure image processing with no models or external downloads involved, so once the pack loads cleanly it works immediately.
Troubleshooting. There's genuinely not much to go wrong here - it's a simple, well-scoped node. The one thing worth double-checking if your downstream results look off is that you're actually resizing to the size your target model expects rather than an arbitrary round number; if you're feeding into an edit or VLM-conditioned pipeline that's sensitive to input resolution (Qwen-Image-Edit and Flux Kontext both are, per community reports), match the size value to what that specific model's documentation or default workflow recommends rather than guessing. If the node itself doesn't appear after install, that points to the pack-wide IMPORT FAILED issue documented on r/comfyui for a missing dependency elsewhere in the pack, not this node - check your ComfyUI console log at startup and reinstall via Manager's "install missing custom nodes."
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| size | INT | 5120–99999 | — |
| interpolation_mode | COMBO | bilinear | 5 options: nearest-exact, bilinear, area, bicubic, lanczos |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |