This custom node for ComfyUI, named Find Perfect Resolution, is designed to compute an optimal resolution for an input image while maintaining its aspect ratio and ensuring that the dimensions are multiples of a specified value. It integrates smoothly into ComfyUI workflows, particularly enhancing image resizing tasks.
- Accepts input images to analyze their original dimensions and aspect ratio.
- Allows users to set target resolution and divisibility constraints for the output dimensions.
- Outputs calculated width and height that adhere to the specified requirements.
Context
Find Perfect Resolution is a specialized node within ComfyUI that focuses on determining the most suitable output dimensions for images. Its main purpose is to facilitate precise resizing while keeping the aspect ratio intact and ensuring that the resulting dimensions meet specific divisibility criteria, which is particularly useful for various processing standards.
Key Features & Benefits
This tool offers practical features such as the ability to input desired width and height, along with a divisibility parameter. By allowing users to specify these values, it ensures that the output dimensions are not only accurate but also compatible with specific requirements, such as those needed for video encoding or other image processing tasks.
Advanced Functionalities
The node employs a mathematical approach to determine the optimal resolution. It calculates the target pixel count based on user-defined dimensions and then derives the new width and height, ensuring they are rounded to the nearest multiple of the specified divisibility value. This functionality is crucial for maintaining image quality during resizing.
Practical Benefits
By utilizing Find Perfect Resolution, users can streamline their workflows in ComfyUI, enhancing control over image outputs. It simplifies the process of resizing images while ensuring compliance with aspect ratio and divisibility requirements, ultimately improving efficiency and the quality of the final images.
Credits/Acknowledgments
This tool is credited to the original developers and contributors, with special thanks to #Verole for the underlying logic that powers its functionality. The node is available under an open-source license, promoting community collaboration and improvement.





