ComfyUI > Nodes > ComfyUI > Resize Images by Shorter Edge

ComfyUI Node: Resize Images by Shorter Edge

Class Name

ResizeImagesByShorterEdge

Category
dataset/image
Author
ComfyAnonymous (Account age: 763days)
Extension
ComfyUI
Latest Updated
2026-05-13
Github Stars
112.77K

How to Install ComfyUI

Install this extension via the ComfyUI Manager by searching for ComfyUI
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Resize Images by Shorter Edge Description

Resize images to match specified shorter edge length while preserving aspect ratio for consistency and integrity.

Resize Images by Shorter Edge:

The ResizeImagesByShorterEdge node is designed to resize images such that the shorter edge of the image matches a specified length, while maintaining the original aspect ratio. This node is particularly useful when you want to standardize the size of images for consistency in datasets or to prepare images for further processing where a specific dimension is required. By focusing on the shorter edge, this node ensures that images are resized proportionally, preventing distortion and preserving the visual integrity of the image. This method is beneficial for applications where maintaining the aspect ratio is crucial, such as in machine learning models that require input images of a consistent size.

Resize Images by Shorter Edge Input Parameters:

shorter_edge

The shorter_edge parameter specifies the target length for the shorter edge of the image. This parameter determines how much the image will be resized, ensuring that the shorter side of the image matches this specified length. The function of this parameter is to provide a consistent dimension for the shorter edge across all images processed by this node. The impact of this parameter is significant as it directly influences the final size of the image while maintaining the aspect ratio. The minimum value for shorter_edge is 1, the maximum is 8192, and the default value is 512. Adjusting this parameter allows you to control the scale of the resizing operation, making it adaptable to various requirements.

Resize Images by Shorter Edge Output Parameters:

resized_image

The output of the ResizeImagesByShorterEdge node is a resized_image, which is the image that has been resized according to the specified shorter_edge parameter. This output is crucial as it provides the resized image that maintains the original aspect ratio, ensuring that the image's proportions are preserved. The resized image can then be used for further processing or analysis, making it an essential component in workflows that require images of a specific size.

Resize Images by Shorter Edge Usage Tips:

  • To maintain the quality of your images, choose a shorter_edge value that is close to the original size of the shorter edge of your images. This minimizes the amount of scaling required and preserves image details.
  • Use this node when preparing images for machine learning models that require input images of a consistent size, as it ensures that all images have the same shorter edge length while maintaining their aspect ratios.

Resize Images by Shorter Edge Common Errors and Solutions:

Image size too small

  • Explanation: This error occurs when the original image's shorter edge is smaller than the specified shorter_edge value, leading to an attempt to upscale the image beyond its original resolution.
  • Solution: Consider using a smaller shorter_edge value that is closer to the original size of the image's shorter edge to avoid excessive upscaling, which can result in a loss of image quality.

Invalid shorter_edge value

  • Explanation: This error arises when the shorter_edge parameter is set to a value outside the allowed range (1 to 8192).
  • Solution: Ensure that the shorter_edge value is within the specified range. Adjust the value to be between 1 and 8192 to prevent this error.

Resize Images by Shorter Edge Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.

Resize Images by Shorter Edge