ComfyUI > Nodes > ComfyUI > Scale Image to Max Dimension

ComfyUI Node: Scale Image to Max Dimension

Class Name

ImageScaleToMaxDimension

Category
image/upscaling
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

Scale Image to Max Dimension Description

Resize images to specified max dimension while maintaining aspect ratio for easy upscaling/downscaling.

Scale Image to Max Dimension:

The ImageScaleToMaxDimension node is designed to resize images by scaling them to a specified maximum dimension while maintaining their aspect ratio. This node is particularly useful when you want to ensure that an image fits within a certain size constraint, such as preparing images for web use or ensuring consistency across a series of images. By automatically adjusting the dimensions based on the larger side of the image, it provides a straightforward way to upscale or downscale images without distorting their original proportions. This node is beneficial for artists and designers who need to quickly and efficiently resize images to fit specific requirements without manually calculating the new dimensions.

Scale Image to Max Dimension Input Parameters:

image

This parameter represents the input image that you want to scale. It is the primary data that the node processes to produce a resized output. The image should be in a format compatible with the node's processing capabilities.

upscale_method

The upscale_method parameter determines the algorithm used for resizing the image. Options include "area", "lanczos", "bilinear", "nearest-exact", and "bicubic". Each method has its characteristics: "area" is good for downscaling, "lanczos" provides high-quality results for both upscaling and downscaling, "bilinear" is faster but may be less sharp, "nearest-exact" is the simplest and fastest, and "bicubic" offers a balance between speed and quality. Choosing the right method can affect the quality and performance of the scaling process.

largest_size

This parameter specifies the maximum size for the longest dimension of the image after scaling. It ensures that the image's largest side does not exceed this value, maintaining the aspect ratio. The default value is 512, with a minimum of 0 and a maximum defined by MAX_RESOLUTION. Adjusting this value allows you to control the final size of the image, making it suitable for various applications.

Scale Image to Max Dimension Output Parameters:

image

The output is the resized image, which has been scaled to fit within the specified maximum dimension while preserving its aspect ratio. This output can be used directly in your projects, ensuring that the image meets the size requirements without any distortion.

Scale Image to Max Dimension Usage Tips:

  • Choose the upscale_method based on your quality and performance needs; for high-quality results, consider using "lanczos" or "bicubic".
  • Set the largest_size parameter according to the maximum dimension you need for your project to ensure consistency across images.

Scale Image to Max Dimension Common Errors and Solutions:

Image size exceeds maximum resolution

  • Explanation: This error occurs when the specified largest_size exceeds the maximum allowed resolution.
  • Solution: Ensure that the largest_size parameter is set within the allowed range, which is defined by MAX_RESOLUTION.

Unsupported image format

  • Explanation: The input image is in a format that the node does not support.
  • Solution: Convert the image to a supported format before using it as input for the node.

Scale Image to Max Dimension 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.

Scale Image to Max Dimension