Nodes/comfyui-moonpack/Proportional Dimension (legacy)
ComfyUI Node

Proportional Dimension (legacy)

The old key, same math, one save away from migrating

By moonwhaler·Created about a year ago·Updated 11 days ago· 16
Proportional Dimension (legacy)
  • from_image
  • width
  • height
  • shortest_side
  • longest_side
  • scale
width1440
height1024
target_size480
target_sideshortest
orientationauto
divisible_by1
roundingnearest
resize_modetarget_side
megapixels1.00

If you see "Proportional Dimension" in a node menu with "(legacy)" after it, you're looking at MoonPack v0.1's old registry key. The current version is registered as MoonPack_ProportionalDimension, and the legacy entry exists so workflows you saved before the v0.2 rename still load without you having to rebuild anything. Same node, same behavior, just an older name.

What it does (briefly)

It rescales a width/height pair proportionally so a chosen side lands on a target size, then snaps both dimensions to a divisor. Full details are on the MoonPack_ProportionalDimension page, but the inputs are the same: width, height, target_size, target_side (shortest/longest), orientation, divisible_by, rounding, and an optional from_image input that reads dimensions straight off an image tensor. Outputs are width, height, shortest_side, longest_side, and scale.

The short version of why it exists: models want dimensions in specific multiples, and doing that division in your head is how you end up with a 736-wide latent that SDXL quietly mangles. This node snaps the math for you.

Why the legacy name matters to you

MoonPack v0.2 (the MoonPack_ prefix release) kept the old ProportionalDimension key as an alias - but the README is explicit that aliases are a bridge, not a permanent state: they're kept for one release cycle and slated for removal in 1.0. So if your workflow still says ProportionalDimension, do this: load it, hit save once, and ComfyUI writes the graph back with MoonPack_ProportionalDimension in its place. That's the whole migration.

It's a one-time, two-click thing. The only way you get bitten is by never re-saving and then updating the pack past the alias's removal date.

Installing it

It's part of MoonPack, so:

cd ComfyUI/custom_nodes
git clone https://github.com/moonwhaler/comfyui-moonpack.git

or ComfyUI Manager → MoonPack, then restart. Under MoonPack/image. No model downloads, no third-party Python dependencies - clean install.

Bottom line

The "(legacy)" is cosmetic; the math underneath is current. Use it if it's already in your workflow, but give it the one re-save now so the next pack update doesn't leave your graph pointing at a key that no longer exists.

CategoryMoonPack/image

Inputs (10)

NameTypeDefaultDescription
widthINT14401–16384Original width in pixels.
heightINT10241–16384Original height in pixels.
target_sizeINT4801–16384Desired size for the selected side. Only used when resize_mode is 'target_side'.
target_sideCOMBOshortestWhich side target_size applies to. 'shortest' upscales the smaller side; 'longest' caps the larger side. Only used when resize_mode is 'target_side'.
orientationCOMBOautoForce output orientation. 'auto' keeps source orientation. 'landscape'/'portrait' swap width/height when source doesn't match. 'square' produces target_size x target_size (ignores target_side).
divisible_byINT11–1024Snap output dimensions to a multiple of this value (1 = no snapping).
roundingCOMBOnearestHow to snap to the divisor. 'floor' guarantees output ≤ ideal; 'ceil' guarantees ≥.
resize_modeCOMBOtarget_side'target_side' uses target_size/target_side above. 'megapixels' uses the megapixels field instead and ignores target_size/target_side.
megapixelsFLOAT1.000.01–100Target total megapixels (width x height / 1e6), aspect ratio preserved. Only used when resize_mode is 'megapixels'.
from_imageoptIMAGEOptional: read width/height from an IMAGE tensor instead of the widgets.

Outputs (5)

NameTypeDescription
widthINT
heightINT
shortest_sideINT
longest_sideINT
scaleFLOAT