ComfyUI > Nodes > ComfyUI-FramePackWrapper_Plus > Find Nearest Bucket

ComfyUI Node: Find Nearest Bucket

Class Name

FramePackFindNearestBucket

Category
FramePackWrapper
Author
ShmuelRonen (Account age: 1553days)
Extension
ComfyUI-FramePackWrapper_Plus
Latest Updated
2025-05-19
Github Stars
0.05K

How to Install ComfyUI-FramePackWrapper_Plus

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

Find Nearest Bucket Description

Resize images by finding closest resolution bucket, maintaining aspect ratio for encoding tasks.

Find Nearest Bucket:

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.

Find Nearest Bucket Input Parameters:

image

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.

base_resolution

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.

Find Nearest Bucket Output Parameters:

width

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.

height

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.

Find Nearest Bucket Usage Tips:

  • To achieve the best results, ensure that the 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.
  • When working with images of varying sizes, consider using a consistent base_resolution to standardize the output dimensions, which can be particularly useful for batch processing or when preparing images for machine learning models.

Find Nearest Bucket Common Errors and Solutions:

Image shape mismatch

  • Explanation: This error occurs when the input image does not have the expected shape or dimensions, which can prevent the node from correctly processing the image.
  • Solution: Ensure that the input image is provided in a compatible format, typically as a multi-dimensional array with the correct number of channels and dimensions. Verify that the image data is correctly loaded and pre-processed before passing it to the node.

Invalid base_resolution value

  • Explanation: This error arises when the base_resolution parameter is set to a value outside the allowed range (64 to 2048).
  • Solution: Adjust the 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.

Find Nearest Bucket Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-FramePackWrapper_Plus
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.