Visit ComfyUI Online for ready-to-use ComfyUI environment
Calculate optimal image dimensions for precise resizing without quality loss, ideal for AI artists.
The PixelPerfectResolution
node is designed to help you achieve the perfect resolution for your images by calculating the optimal dimensions based on the target height and width, as well as the resize mode. This node ensures that your images are resized accurately without losing quality, making it ideal for tasks that require precise image dimensions. By leveraging advanced algorithms, it computes the best possible resolution, maintaining the integrity and clarity of your images. This is particularly useful for AI artists who need to upscale or downscale images while preserving the original details and avoiding distortions.
This parameter takes an image in the form of a NumPy array. The image serves as the base from which the node will calculate the optimal resolution. The quality and dimensions of this input image directly impact the final output, so it is essential to provide a high-quality image for the best results.
This parameter specifies the target height for the image. It is an integer value that determines the desired height of the output image. The node uses this value to calculate the optimal resolution, ensuring that the image is resized accurately. There is no explicit minimum or maximum value, but it should be a positive integer that makes sense for your specific use case.
This parameter specifies the target width for the image. Similar to target_H
, it is an integer value that determines the desired width of the output image. The node uses this value in conjunction with the target height to compute the best possible resolution. Ensure that this value is a positive integer appropriate for your needs.
This parameter defines the mode of resizing to be used. It can take values from the ResizeMode
enumeration, such as ResizeMode.OUTER_FIT
or ResizeMode.INNER_FIT
. The chosen mode affects how the image is scaled and cropped, impacting the final resolution. Selecting the appropriate resize mode is crucial for achieving the desired output.
This output parameter provides the estimated optimal resolution as an integer. It represents the computed value that ensures the image is resized accurately according to the specified target height, target width, and resize mode. This value is crucial for maintaining the quality and integrity of the image during the resizing process.
resize_mode
based on whether you want the image to fit within the target dimensions (INNER_FIT
) or to cover the entire area (OUTER_FIT
).resize_mode
provided is not recognized.resize_mode
from the ResizeMode
enumeration, such as ResizeMode.OUTER_FIT
or ResizeMode.INNER_FIT
.© Copyright 2024 RunComfy. All Rights Reserved.