Nodes/ComfyUI/Resize Images by Longer Edge (DEPRECATED)
ComfyUI Node Runs on cloud

Resize Images by Longer Edge (DEPRECATED)

Resize Images by Longer Edge — still in your workflow, but it's been replaced

By Comfy-Org·Created 4 years ago·Updated 6 minutes ago· 129,952
Resize Images by Longer Edge (DEPRECATED)
  • images
  • images
longer_edge1024

The name is honest: this node scales an image so its longer edge hits a target, and the other edge follows to keep the aspect ratio. It's the "make sure nothing is smaller than X" resizer. And as the display name now says in big letters, it's DEPRECATED - ComfyUI replaced it with a single node that does this and half a dozen other resize modes. If you're building something new, use that instead. If you're unwrapping an old workflow, here's what this one does.

What it does

Feed it images and a longer_edge (default 1024). It works out which edge is the long one, scales the image so that edge equals your number, and the short edge comes along for the ride. A 2048×1024 image with longer_edge 1024 becomes 1024×512. A portrait 1024×2048 becomes 512×1024. Same shape, half the pixels.

Two implementation details worth knowing:

  • It uses LANCZOS resampling. For downscaling that's clean and cheap - this is "more pixels, not more detail," the interpolator lane, not a generative upscaler.
  • It's batch-aware. Give it a stack of images (say, all frames of a video) and each one gets the same longer-edge treatment independently, so the batch comes back with matching long edges. That's its real niche: normalizing a mixed-size batch before it hits a model or a grid.

Inputs and output

  • images - the IMAGE(s) to process.
  • longer_edge - target for the longer side, 1 to 8192, default 1024.

Output is a single images batch of resized tensors. That's the whole schema. It's a toy in the best sense: nothing to configure, one number to type.

Where people get burned

The trap is latent math, not the resize. A target of 1024 on an odd-aspect image gives you something like 1024×613. That's not a multiple of 8 (and absolutely not 64), so when you VAE-encode it the encoder crops the canvas down to a latent-friendly size - and you get a surprise strip shaved off the edge. If the resize is a pre-step before sampling, pick targets that keep both dimensions on multiples of 8, or follow it with a pad node. For reference images feeding a ControlNet it's usually fine.

The other trap is treating "longer edge" as a quality dial. Resizing 512→1024 with Lanczos adds zero detail - it's interpolation. If you want actual new pixels, you want a real upscaler (ESRGAN-family, or a diffusion upscale pass), not this node.

Use the replacement instead

ComfyUI's newer Resize Image/Mask node (ResizeImageMaskNode) has a "scale longer dimension" mode that's the direct successor, plus "scale shorter dimension," "scale by factor," "scale to total pixels," and more - and it handles masks too, so your mask and image stay aligned. The source marks this node and its sibling as "superseded by Resize Image/Mask with resize_type = scale longer dimension." The community's been on the newer node since it landed in 2026, and this one only survives in saved workflows.

So: if you're cloning a workflow and see it, now you know exactly what it's doing and why it's flagged. If you're starting fresh, add Resize Image/Mask and pick "scale longer dimension" - one node instead of one node plus a deprecation warning.

Categoryimage/transform

Inputs (2)

NameTypeDefaultDescription
imagesIMAGEImage to process.
longer_edgeINT10241–8192Target dimension for the longer edge.

Outputs (1)

NameTypeDescription
imagesIMAGEProcessed images