Save 4 hours! We auto-setup your workflow! Free!

Drop your workflow.json — we handle every dependency, custom node, and model. Just open the link and run.

Auto-Setup Workflow Json (Free) Now!
ComfyUI > Nodes > comfyui-obvpm > Downscale Image to Megapixels (obvpm)

ComfyUI Node: Downscale Image to Megapixels (obvpm)

Class Name

DownscaleImageToMegapixels (obvpm)

Category
obvpm/image
Author
chanon (Account age: 5883days)
Extension
comfyui-obvpm
Latest Updated
2026-09-17
Github Stars
0.04K

How to Install comfyui-obvpm

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

Downscale Image to Megapixels (obvpm) Description

Efficiently downscales images to specified megapixel limit while preserving aspect ratio and quality.

DownscaleImageToMegapixels (obvpm):

The DownscaleImageToMegapixels node is designed to efficiently reduce the size of an image so that its total pixel count fits within a specified megapixel limit, while maintaining the original aspect ratio. This node is particularly useful when you need to manage image sizes for processing or storage constraints without compromising the image's proportions. It automatically determines whether an image needs to be downscaled based on its current pixel count compared to the target megapixels. If the image is already within the desired size, it remains unchanged, ensuring that smaller images pass through untouched. This functionality is crucial for workflows where maintaining image quality and aspect ratio is important, while also adhering to size limitations.

DownscaleImageToMegapixels (obvpm) Input Parameters:

megapixels

This parameter specifies the maximum number of megapixels the image should be downscaled to. It determines the target size for the image in terms of total pixel count. The node calculates the necessary scaling factor to ensure the image fits within this limit while preserving its aspect ratio. The value is expressed in megapixels, where 1 megapixel equals 1,024,000 pixels. There is no explicit minimum or maximum value provided, but it should be a positive number.

method

The method parameter defines the interpolation technique used during the downscaling process. Different methods can affect the quality and appearance of the downscaled image. Common methods include "nearest-exact," "bilinear," "area," "bicubic," and "lanczos." Each method has its own characteristics, with some providing smoother results and others preserving more detail. The choice of method can impact the final image quality, so selecting the appropriate one based on your needs is important.

resolution_steps

This parameter controls the granularity of the resolution adjustment. It specifies the step size for the resolution grid, ensuring that the new dimensions of the image align with this grid. The default value is 1, meaning the image can be resized to any dimension. Increasing this value can help maintain a consistent grid alignment, which might be necessary for certain applications. The minimum value is 1, and there is no specified maximum, but it should be a positive integer.

image

This is the input image that you want to downscale. If no image is connected, the node will output None, effectively bypassing the operation. The image should be in a compatible format that the node can process, typically a tensor or array representing the image data.

DownscaleImageToMegapixels (obvpm) Output Parameters:

image

The output parameter is the downscaled image, if the original image exceeded the specified megapixel target. If the image was already within the desired size, it is returned unchanged. In cases where no image is connected, the output will be None. This ensures that the node only modifies images when necessary, preserving the original quality and dimensions when possible.

DownscaleImageToMegapixels (obvpm) Usage Tips:

  • To maintain the best image quality, choose an interpolation method that suits your specific needs. For example, "lanczos" is often preferred for high-quality downscaling.
  • Use the resolution_steps parameter to ensure that the downscaled image dimensions align with specific grid requirements, which can be important for certain applications like tiling or printing.

DownscaleImageToMegapixels (obvpm) Common Errors and Solutions:

Image is None

  • Explanation: This error occurs when no image is connected to the node, resulting in a None output.
  • Solution: Ensure that an image is properly connected to the node before executing the downscaling operation.

Invalid Megapixels Value

  • Explanation: If the megapixels parameter is set to a non-positive value, the node may not function correctly.
  • Solution: Verify that the megapixels parameter is set to a positive number to ensure proper downscaling.

Unsupported Interpolation Method

  • Explanation: Using an unsupported interpolation method can lead to unexpected results or errors.
  • Solution: Double-check the available interpolation methods and select one that is supported by the node, such as "nearest-exact," "bilinear," "area," "bicubic," or "lanczos."

Downscale Image to Megapixels (obvpm) Related Nodes

Go back to the extension to check out more related nodes.
comfyui-obvpm
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 Models, enabling artists to harness the latest AI tools to create incredible art.

Downscale Image to Megapixels (obvpm)