Visit ComfyUI Online for ready-to-use ComfyUI environment
Resize images while maintaining aspect ratio to fit within specified size constraints.
The FS: Fit Size From Int node is designed to help you resize images while maintaining their aspect ratio. This node is particularly useful when you need to ensure that an image fits within a specified maximum size, either by scaling it down or up. The primary goal of this node is to calculate the optimal width and height for an image so that it fits within the given constraints without distorting its original proportions. This is especially beneficial for AI artists who need to prepare images for various applications, ensuring that the images are appropriately sized for their intended use.
This parameter represents the original width of the image in pixels. It is an integer value that specifies the starting width before any resizing is applied. The function of this parameter is to provide the node with the initial width of the image so that it can calculate the new dimensions based on the maximum size constraint. There are no minimum or maximum values specified for this parameter, but it should be a positive integer.
This parameter represents the original height of the image in pixels. Similar to the original_width, it is an integer value that specifies the starting height before any resizing is applied. The function of this parameter is to provide the node with the initial height of the image so that it can calculate the new dimensions based on the maximum size constraint. There are no minimum or maximum values specified for this parameter, but it should be a positive integer.
This parameter sets the maximum size (in pixels) that either the width or height of the image can be after resizing. It is an integer value with a default of 768 pixels and increments in steps of 8 pixels. The function of this parameter is to define the upper limit for the resized image dimensions, ensuring that the image does not exceed this size while maintaining its aspect ratio. This parameter helps in controlling the final size of the image to fit specific requirements.
This parameter is a boolean option that determines whether the image should be upscaled if its original dimensions are smaller than the specified max_size. The available options are "false" and "true". When set to "false", the image will only be scaled down if it exceeds the max_size, but will not be upscaled. When set to "true", the image can be both scaled down and up to fit within the max_size constraint. This parameter is useful for ensuring that smaller images can be enlarged to meet the size requirements.
This output parameter represents the new width of the image after resizing. It is an integer value that indicates the optimal width calculated based on the original dimensions and the max_size constraint. The Fit Width ensures that the image fits within the specified maximum size while maintaining its aspect ratio.
This output parameter represents the new height of the image after resizing. It is an integer value that indicates the optimal height calculated based on the original dimensions and the max_size constraint. The Fit Height ensures that the image fits within the specified maximum size while maintaining its aspect ratio.
This output parameter represents the aspect ratio of the image after resizing. It is a float value that indicates the ratio of the width to the height of the image. The Aspect Ratio helps in understanding the proportional relationship between the width and height of the resized image, ensuring that the image's original proportions are preserved.
© Copyright 2024 RunComfy. All Rights Reserved.