ComfyUI > Nodes > DJZ-Nodes > Image Size Adjuster

ComfyUI Node: Image Size Adjuster

Class Name

ImageSizeAdjuster

Category
DJZ-Nodes
Author
DriftJohnson (Account age: 4052days)
Extension
DJZ-Nodes
Latest Updated
2025-04-25
Github Stars
0.04K

How to Install DJZ-Nodes

Install this extension via the ComfyUI Manager by searching for DJZ-Nodes
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter DJZ-Nodes 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

Image Size Adjuster Description

Intelligently resize images for AI models while maintaining aspect ratio and optimizing for specific types like SD, SDXL, and Cascade.

Image Size Adjuster:

The ImageSizeAdjuster node is designed to intelligently resize images while maintaining their aspect ratio and optimizing them for specific model types such as SD, SDXL, and Cascade. This node is particularly beneficial for AI artists who need to prepare images for different AI models, ensuring that the images are resized to the appropriate dimensions without losing quality or distorting the original aspect ratio. By calculating the target pixel count based on the model type and adjusting the dimensions accordingly, the ImageSizeAdjuster helps streamline the image preparation process, making it easier to achieve optimal results in AI-driven art projects.

Image Size Adjuster Input Parameters:

image

The image parameter represents the input image that you want to resize. It is crucial as it serves as the base for all resizing operations. The dimensions of this image will be adjusted according to the specified model type and other parameters to achieve the desired output size.

model_type

The model_type parameter specifies the AI model for which the image is being prepared. Options include 'SD', 'SDXL', and 'Cascade', each corresponding to different target pixel counts. This parameter is essential as it determines the target resolution and pixel count for the resizing process.

downscale_factor

The downscale_factor parameter is used to ensure that the new dimensions of the image are divisible by this factor. This is important for maintaining compatibility with certain models that require specific dimension constraints. It helps in achieving a clean and precise resizing operation.

rounding_method

The rounding_method parameter dictates how the dimensions should be rounded during the resizing process. This can affect the final size of the image and is important for fine-tuning the output dimensions to meet specific requirements.

preserve_original

The preserve_original parameter is a boolean that, when set to true, attempts to keep the original dimensions of the image as much as possible. This is useful when you want to maintain the original size while still adjusting for model-specific requirements.

force_square

The force_square parameter, when enabled, forces the output image to have equal width and height, resulting in a square image. This is particularly useful for models or applications that require square inputs.

scaling_factor

The scaling_factor parameter allows you to scale the target pixel count by a specific factor, providing additional control over the final image size. This can be useful for fine-tuning the resolution beyond the default model-specific settings.

max_width

The max_width parameter sets an upper limit on the width of the resized image. This ensures that the image does not exceed a certain width, which can be important for maintaining compatibility with certain models or applications.

max_height

The max_height parameter sets an upper limit on the height of the resized image. Similar to max_width, this ensures that the image does not exceed a certain height, maintaining compatibility with specific requirements.

Image Size Adjuster Output Parameters:

adjusted_width

The adjusted_width output parameter represents the final width of the resized image. It is calculated based on the input parameters and ensures that the image is optimized for the specified model type while maintaining the aspect ratio.

adjusted_height

The adjusted_height output parameter represents the final height of the resized image. Like adjusted_width, it is determined by the input parameters and ensures that the image is resized appropriately for the target model.

applied_scale

The applied_scale output parameter indicates the scale factor that was applied to the original image to achieve the resized dimensions. This provides insight into how much the image was scaled during the resizing process.

original_width

The original_width output parameter provides the width of the input image before any resizing was applied. This is useful for reference and comparison with the adjusted dimensions.

original_height

The original_height output parameter provides the height of the input image before resizing. It serves as a reference point to understand the changes made during the resizing process.

Image Size Adjuster Usage Tips:

  • To maintain the original aspect ratio while resizing, ensure that the preserve_original parameter is set to true.
  • Use the scaling_factor to fine-tune the resolution of the output image, especially if the default model-specific settings do not meet your needs.
  • If you need a square image, enable the force_square parameter to automatically adjust the dimensions accordingly.

Image Size Adjuster Common Errors and Solutions:

Invalid model type specified

  • Explanation: The model_type parameter was set to a value that is not recognized by the node.
  • Solution: Ensure that the model_type is set to one of the supported options: 'SD', 'SDXL', or 'Cascade'.

Image dimensions exceed maximum limits

  • Explanation: The calculated dimensions exceed the specified max_width or max_height.
  • Solution: Adjust the max_width and max_height parameters to accommodate larger dimensions or reduce the scaling factor.

Downscale factor not compatible with dimensions

  • Explanation: The downscale_factor is not compatible with the calculated dimensions, leading to rounding issues.
  • Solution: Choose a downscale_factor that is a divisor of the desired dimensions to ensure compatibility.

Image Size Adjuster Related Nodes

Go back to the extension to check out more related nodes.
DJZ-Nodes
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 Playground, enabling artists to harness the latest AI tools to create incredible art.