Visit ComfyUI Online for ready-to-use ComfyUI environment
Intelligently resize images for AI models while maintaining aspect ratio and optimizing for specific types like SD, SDXL, and Cascade.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
preserve_original
parameter is set to true.scaling_factor
to fine-tune the resolution of the output image, especially if the default model-specific settings do not meet your needs.force_square
parameter to automatically adjust the dimensions accordingly.model_type
parameter was set to a value that is not recognized by the node.model_type
is set to one of the supported options: 'SD', 'SDXL', or 'Cascade'.max_width
or max_height
.max_width
and max_height
parameters to accommodate larger dimensions or reduce the scaling factor.downscale_factor
is not compatible with the calculated dimensions, leading to rounding issues.downscale_factor
that is a divisor of the desired dimensions to ensure compatibility.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.