Nodes/ComfyUI_MieNodes/Classic Aspect Ratio ๐Ÿ‘
ComfyUI Node

Classic Aspect Ratio ๐Ÿ‘

Pick a ratio, get model-friendly width and height

By MieMieeeeeยทCreated about a year agoยทUpdated 22 days agoยท 225
Classic Aspect Ratio ๐Ÿ‘
    • width
    • height
    โ—„ratio1:1โ–บ
    โ—„resolution1024x1024 ( 1MP )โ–บ

    Every time you want a 16:9 image you end up doing mental arithmetic: what's 16:9 at roughly a megapixel, rounded to something the model won't choke on? This node does that for you. You pick a ratio from a dropdown and a pixel budget, and it hands back a clean width and height pair you plug straight into your empty latent. That's the whole job, and it's a genuinely nice quality-of-life win once you stop typing dimensions by hand.

    It's part of ComfyUI-MieNodes (ComfyUI_MieNodes), MieMieeeee's sprawling utility pack, filed under the ๐Ÿ‘ Common menu.

    Why you'd reach for it

    Diffusion models are picky about dimensions. SDXL was trained on a specific set of bucketed resolutions; Flux and the newer models like their sides as multiples of 16 or 64 and their total pixel count in a sane range. Feed a sampler some oddball size like 1000x600 and you get worse composition, seams, or a flat refusal. The safe move is to stay on known-good resolutions, and this node just encodes the common ones so you don't have to memorize them.

    The "classic" in the name is the giveaway: these are the standard photo and screen ratios - square, portrait and landscape 2:3 and 3:4, the 9:16 and 16:9 you'd want for phone and video framing, and the ultrawide 21:9. Nothing exotic, which is exactly the point.

    How it works

    Two dropdowns, two numbers out. You choose a ratio and a resolution, and the node computes the actual width and height that land on that aspect ratio near the chosen pixel budget. The resolution choices are written as squares with their megapixel count - 1024x1024 ( 1MP ), 1536x1536 ( 2.25MP ), and so on - so read the megapixel figure as the target: a 16:9 at the 1MP setting comes out as a wide frame carrying about the same number of pixels as a 1024 square, not a literal 1024-tall image. That keeps VRAM and generation time predictable no matter which ratio you switch to.

    The inputs and outputs that matter

    Both inputs are required, and there are only two:

    • ratio - the shape. Eleven options from 1:1 through 2:3, 3:4, 4:3, 7:9, 9:7, 9:16, 16:9, up to 9:21 and 21:9. Default is 1:1.
    • resolution - the pixel budget, from 512x512 ( 0.25MP ) up to 2048x2048 ( 4MP ). Default is the 1024x1024 ( 1MP ) sweet spot.

    Outputs are width and height, both plain INT. Wire them into an Empty Latent Image node's width and height, or into anything that takes integer dimensions. Done.

    Installing it

    ComfyUI Manager โ†’ search ComfyUI-MieNodes โ†’ install โ†’ restart. Or by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/MieMieeeee/ComfyUI-MieNodes
    

    then restart. No model download, no heavy dependencies - it's pure arithmetic. Nodes show up under the ๐Ÿ‘ MieNodes menu.

    Common issues & troubleshooting

    Match the budget to your model. The 1MP setting is right for SDXL and Flux-class models. Older SD 1.5 wants roughly 0.25โ€“0.5MP (the 512 or 768 options), and pushing it to 2MP native usually gives you doubled bodies, not more detail. If you want a big image, generate at the model's happy size and upscale after.

    A 4MP direct generation is a VRAM trap. The 2048 option exists, but generating natively at 4MP on a heavy model like Flux 2 will punish a consumer card - the KB pegs even Flux 2 Dev at 18โ€“24GB quantized before you go oversized. Treat the top of the list as "I have the hardware," not a default.

    It only outputs numbers. This node doesn't create a latent or an image; it just computes dimensions. If nothing seems to happen, that's expected - check that the width/height are actually wired into your latent node downstream.

    Category๐Ÿ‘ MieNodes/๐Ÿ‘ Common

    Inputs (2)

    NameTypeDefaultDescription
    ratioCOMBO1:111 options: 1:1, 2:3, 3:2, 3:4, 4:3, 7:9, +5
    resolutionCOMBO1024x1024 ( 1MP )6 options: 512x512 ( 0.25MP ), 768x768 ( 0.56MP ), 1024x1024 ( 1MP ), 1280x1280 ( 1.56MP ), 1536x1536 ( 2.25MP ), 2048x2048 ( 4MP )

    Outputs (2)

    NameTypeDescription
    widthINTโ€”
    heightINTโ€”