ComfyUI > Nodes > DJZ-Nodes > Image Size Adjuster V2

ComfyUI Node: Image Size Adjuster V2

Class Name

ImageSizeAdjusterV2

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 V2 Description

Intelligently resize images for AI model requirements while maintaining aspect ratio and quality.

Image Size Adjuster V2:

The ImageSizeAdjusterV2 node is designed to intelligently adjust the dimensions of an image to meet specific requirements while maintaining its aspect ratio and quality. This node is particularly useful for AI artists who need to prepare images for different model types such as SD, SDXL, and Cascade, which have distinct pixel count requirements. By leveraging this node, you can ensure that your images are resized to fit within the constraints of these models, optimizing them for further processing or analysis. The node offers flexibility through various parameters, allowing you to control the scaling factor, rounding methods, and whether to preserve the original dimensions or force a square aspect ratio. This makes it a powerful tool for managing image sizes efficiently and effectively, ensuring that your images are always ready for the next step in your creative workflow.

Image Size Adjuster V2 Input Parameters:

image

This parameter represents the input image that you want to adjust. The image should be in a format that the node can process, typically a multi-dimensional array representing pixel data. The dimensions of the image will be analyzed to determine the necessary adjustments.

model_type

The model_type parameter specifies the target model for which the image is being prepared. Options include 'SD', 'SDXL', and 'Cascade', each corresponding to different total pixel requirements. This parameter is crucial as it determines the target pixel count for the resizing operation.

downscale_factor

This parameter defines the factor by which the image dimensions should be divisible. It ensures that the adjusted dimensions are compatible with the downscaling requirements of the target model, helping to maintain image quality and integrity.

rounding_method

The rounding_method parameter dictates how the new dimensions should be rounded. This can affect the final size of the image and is important for ensuring that the dimensions meet specific criteria or constraints.

preserve_original

This boolean parameter indicates whether the original dimensions of the image should be preserved as much as possible. If set to true, the node will attempt to keep the original width and height, adjusting only as necessary to meet other constraints.

force_square

When set to true, this parameter forces the adjusted image to have equal width and height, resulting in a square image. This can be useful for models or applications that require square inputs.

scaling_factor

The scaling_factor allows you to scale the target pixel count by a specific factor, providing additional control over the resizing process. The default value is 1.0, meaning no additional scaling is applied.

max_width

This parameter sets the maximum allowable width for the adjusted image. It ensures that the image does not exceed a certain width, which can be important for compatibility with certain models or applications.

max_height

Similar to max_width, this parameter sets the maximum allowable height for the adjusted image. It helps to keep the image within specific height constraints.

Image Size Adjuster V2 Output Parameters:

adjusted_width

The adjusted_width is the final width of the image after all adjustments have been applied. It reflects the new dimension that meets the specified requirements and constraints.

adjusted_height

The adjusted_height is the final height of the image after adjustments. Like the width, it is calculated to ensure compatibility with the target model and other parameters.

applied_scale

This output represents the scale factor that was applied to the original image to achieve the adjusted dimensions. It provides insight into how much the image was resized.

original_width

The original_width is the width of the input image before any adjustments were made. It is useful for comparison and understanding the extent of the resizing.

original_height

The original_height is the height of the input image before adjustments. It serves a similar purpose as the original width, providing context for the resizing process.

Image Size Adjuster V2 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 size of the output image, especially if you need to meet specific pixel count requirements.
  • If your application requires square images, set the force_square parameter to true to automatically adjust the dimensions accordingly.

Image Size Adjuster V2 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 adjusted image dimensions exceed the specified max_width or max_height.
  • Solution: Check the max_width and max_height parameters and adjust them to accommodate the desired image size.

Downscale factor not compatible

  • Explanation: The downscale_factor does not divide evenly into the adjusted dimensions.
  • Solution: Adjust the downscale_factor to ensure it is compatible with the desired image dimensions.

Image Size Adjuster V2 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.