Visit ComfyUI Online for ready-to-use ComfyUI environment
Resize images by finding closest resolution bucket, maintaining aspect ratio for encoding tasks.
The FramePackFindNearestBucket
node is designed to assist in resizing images by finding the closest resolution bucket that matches the original image's dimensions. This node is particularly useful when you need to encode images at a specific resolution while maintaining the aspect ratio as closely as possible. By leveraging a predefined set of resolution buckets, the node ensures that the resized image fits within the desired dimensions, optimizing the image for further processing or encoding tasks. This functionality is crucial for applications where consistent image sizes are required, such as in machine learning models or digital art projects. The node's ability to scale the selected bucket based on a specified base resolution adds flexibility, allowing you to tailor the output to your specific needs.
The image
parameter represents the image that you want to resize. It is crucial for the node's operation as it determines the original dimensions that will be used to find the nearest resolution bucket. The image should be provided in a format that the node can process, typically as a multi-dimensional array representing pixel data. This parameter does not have specific minimum or maximum values, but the image's dimensions will directly influence the resizing process.
The base_resolution
parameter specifies the width of the image to encode, serving as a reference point for scaling the selected resolution bucket. It allows you to adjust the output dimensions to fit a particular width, ensuring that the resized image meets your requirements. The base_resolution
has a default value of 640, with a minimum of 64 and a maximum of 2048, adjustable in steps of 16. This flexibility enables you to fine-tune the output size according to your project's needs.
The width
output parameter represents the width of the resized image after the nearest resolution bucket has been determined and applied. It is an integer value that indicates the final horizontal dimension of the image, ensuring that it fits within the selected bucket while maintaining the aspect ratio as closely as possible.
The height
output parameter indicates the height of the resized image, similar to the width
parameter. It provides the final vertical dimension of the image, ensuring that the resized image maintains the aspect ratio and fits within the selected resolution bucket. Together with the width
, it defines the new dimensions of the image after processing.
base_resolution
is set to a value that closely matches your desired output size, as this will help maintain the image's aspect ratio while fitting it into the nearest resolution bucket.base_resolution
to standardize the output dimensions, which can be particularly useful for batch processing or when preparing images for machine learning models.base_resolution
parameter is set to a value outside the allowed range (64 to 2048).base_resolution
to fall within the specified range, ensuring it is a multiple of 16. This will allow the node to correctly scale the selected resolution bucket and produce the desired output size.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.