Visit ComfyUI Online for ready-to-use ComfyUI environment
Upscale images to specified total pixels for resolution consistency, supporting various upscale methods.
The ImageScaleToTotalPixels
node is designed to upscale an image to a specified total number of pixels, measured in megapixels. This node is particularly useful when you need to ensure that your image reaches a certain resolution without manually calculating the dimensions. By specifying the desired total pixel count, the node automatically calculates the appropriate scaling factor and resizes the image accordingly. This can be especially beneficial for AI artists who want to maintain a consistent level of detail across different images or prepare images for high-resolution displays or prints. The node supports various upscale methods, allowing you to choose the one that best suits your needs, whether you prioritize speed, quality, or a balance of both.
This parameter represents the input image that you want to upscale. The image should be provided in a format that the node can process, typically as a tensor or an array. The quality and resolution of the input image will affect the final output, so starting with a high-quality image is recommended.
This parameter allows you to choose the method used for upscaling the image. The available options are "nearest-exact"
, "bilinear"
, "area"
, "bicubic"
, and "lanczos"
. Each method has its own characteristics: "nearest-exact"
is fast but may produce blocky results, "bilinear"
and "bicubic"
offer smoother results, "area"
is good for downscaling, and "lanczos"
provides high-quality results but is computationally intensive. The default method is typically "bilinear"
.
This parameter specifies the total number of pixels you want the output image to have, measured in megapixels. The value can range from 0.01 to 16.0, with a default of 1.0 megapixels. Adjusting this value will directly impact the resolution of the output image. For example, setting it to 2.0 will result in an image with twice the number of pixels as the default setting.
The output parameter is the upscaled image, returned in the same format as the input image. The dimensions of the output image are calculated based on the specified total pixel count (megapixels) and the chosen upscale method. The output image will have the same aspect ratio as the input image but with a higher resolution, ensuring that the total number of pixels matches the specified megapixels.
"lanczos"
for high-quality prints and "bilinear"
for faster processing.ValueError: Invalid upscale method
"nearest-exact"
, "bilinear"
, "area"
, "bicubic"
, or "lanczos"
.ValueError: Megapixels out of range
RuntimeError: Insufficient memory for upscaling
"nearest-exact"
or "bilinear"
.© Copyright 2024 RunComfy. All Rights Reserved.