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-ResolutionHelper > Resolution from Dimensions

ComfyUI Node: Resolution from Dimensions

Class Name

ResolutionFromDimensions

Category
Resolution Tools
Author
alfredsartan572 (Account age: 0days)
Extension
ComfyUI-ResolutionHelper
Latest Updated
2026-11-11
Github Stars
0.0K

How to Install ComfyUI-ResolutionHelper

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

Resolution from Dimensions Description

Scales image dimensions to a target pixel budget, then rounds both down to a chosen multiple.

Resolution from Dimensions:

ResolutionFromDimensions calculates a new image resolution from existing dimensions while aiming for a selected pixel budget. It scales both dimensions by the same factor to retain the original shape, then rounds each dimension down to a chosen size increment. This helps you prepare dimensions for an image-generation workflow without manually calculating a scale factor. Because the rounding happens after scaling, the final pixel count can be below the target and the aspect ratio can shift slightly.

Resolution from Dimensions Input Parameters:

width

The starting image width in pixels. Together with height, it establishes the shape that the calculated resolution aims to retain; it does not set the final width directly. The interface accepts integers from 8 to 7680 in steps of 1. No default is specified in the provided source.

height

The starting image height in pixels. Together with width, it determines the starting shape and the scale needed to approach the selected pixel budget. The interface accepts integers from 8 to 7680 in steps of 1. No default is specified in the provided source.

pixelbudget

The target size category used to calculate the new dimensions. Each dropdown choice maps to a numeric value; the node uses that value to define a target pixel area equivalent to the value squared, multiplied by 16/9. The available choice names, their numeric values, and a default are not present in the provided source because the dropdown comes from PIXEL_BUDGET_LIST. Choose from the options shown in your installed node rather than assuming a particular preset exists.

multiple

The size increment for both calculated dimensions. After scaling, the node rounds each dimension down to the nearest multiple of this value. A larger increment may move the final pixel count farther below the target, especially for small images. The default is 32; the allowed range is 1 to 64 in steps of 1. The interface tooltip suggests 32 for MiniMaxH3, 8 for Illustrious/Pony, and 16 for other uses; confirm the requirements of the model you are using.

Resolution from Dimensions Output Parameters:

width

The calculated width in pixels, returned as an integer. It is the scaled starting width rounded down to a multiple of multiple, so it may be smaller than the width obtained from scaling alone. Use this value as the width setting in a downstream node.

height

The calculated height in pixels, returned as an integer. It is scaled by the same factor as the starting width and then rounded down independently to a multiple of multiple. Use it alongside the calculated width rather than pairing it with the original width.

longest

The larger of the calculated width and height values, in pixels. This gives you the final long-edge size at a glance, whether the result is landscape, portrait, or square.

megapixels

The final calculated pixel count expressed in megapixels, returned as a floating-point number. The node computes it as calculated width × calculated height ÷ 1024 ÷ 1024. It reflects the dimensions after rounding, not the unrounded target budget; the node therefore uses 1,048,576 pixels per displayed megapixel.

Resolution from Dimensions Usage Tips:

  • Enter the dimensions of the shape you want to preserve. For example, starting with a wider-than-tall image produces a wider-than-tall result, although rounding can alter the ratio slightly.
  • Select a pixelbudget option based on the approximate output size you need, then check megapixels to see the pixel count actually produced after rounding.
  • Set multiple to the increment required by your downstream workflow. The source tooltip suggests 32 for MiniMaxH3, 8 for Illustrious/Pony, and 16 for other uses, but those suggestions do not verify compatibility with every setup.
  • If the result falls noticeably below the intended budget, try a smaller compatible multiple. Rounding down in smaller increments generally discards fewer pixels.
  • Pass both calculated dimensions to downstream size settings. Using one calculated dimension with one original dimension would lose the pair this node computed.

Resolution from Dimensions Common Errors and Solutions:

Width or height is outside the allowed range

  • Explanation: The interface specifies a minimum of 8 and a maximum of 7680 for each starting dimension. The exact validation message depends on the host and is not defined in this node source.
  • Solution: Enter whole-number values from 8 through 7680 for both width and height.

Multiple is outside the allowed range

  • Explanation: The interface allows multiple values from 1 through 64. An out-of-range value may be rejected by interface validation; the exact message is not specified in the source.
  • Solution: Choose a whole number from 1 to 64 that meets your downstream workflow’s requirements.

Invalid pixelbudget selection

  • Explanation: The calculation looks up pixelbudget in PIXEL_BUDGET_LIST. A value that is not a key in that mapping cannot be looked up. The list and its possible error messages are not included in the provided source.
  • Solution: Select an option from the node’s current dropdown. If a saved workflow refers to an unavailable option, reselect an available one in the installed version.

Calculated width or height is zero

  • Explanation: The node rounds each scaled dimension down to a multiple of multiple. If a scaled dimension is smaller than that increment, rounding produces zero. The source does not raise a dedicated error for this condition, but a downstream image node may reject the result.
  • Solution: Check the calculated width and height before using them. Try a smaller multiple or a different available pixelbudget that yields larger dimensions.

Final megapixels are lower than expected

  • Explanation: The pixel budget determines the scale before rounding. Rounding both dimensions down reduces the final pixel count, and the source does not adjust them again afterward. This is an expected result, not an error message.
  • Solution: Use the megapixels output to assess the actual result. If your workflow permits it, reduce multiple to limit the amount rounded away.

Aspect ratio is not exactly preserved

  • Explanation: Both starting dimensions receive the same scale factor, but each is subsequently rounded down separately. That can make the final width-to-height ratio slightly different from the starting ratio; the source does not report this as an error.
  • Solution: Use a smaller compatible multiple when a closer match matters, and check the final width and height before generating an image.

Resolution from Dimensions Related Nodes

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