Nodes/ComfyUi-MzMaXaM/Select Latent Size Plus
ComfyUI Node

Select Latent Size Plus

Aspect-ratio-first resolution picking, with the numbers to match

By MzMaXaM·Created 2 years ago·Updated about a year ago· 14
Select Latent Size Plus
    • Latent
    • Width
    • Height
    aspect_ratio1:1 Square Format
    resolution512x512
    swap_orientationdisable
    batch_size1

    This is the flagship of the pack's three resolution pickers, and the one the author actually posted about on r/comfyui. The pitch is simple: instead of typing width and height numbers into a plain Empty Latent Image node and hoping they're sane, you pick an aspect ratio first (1:1, 9:16, 2:3, and a dozen others), then a resolution within that ratio from a curated dropdown - and it hands you the empty latent plus the actual width and height as separate number outputs, so downstream nodes that need the raw dimensions don't have to guess.

    What it actually gives you over the plain version

    Two things the pack's other two size pickers don't have. First, swap_orientation - flip portrait to landscape (or back) without hunting through the dropdown for the mirrored entry. Second, real Width and Height outputs alongside the latent, as plain integers you can wire into anything downstream that wants the numbers - a resize step, metadata, whatever. The other two pickers in this pack only ever hand you an opaque latent.

    Worth knowing: this isn't the only resolution picker in the ecosystem. ComfyRoll had one, though it's gone unmaintained; Kijai's KJNodes pack has a JSON-driven version that's more flexible if you want fully custom presets of your own. This one's case for existing is that it just works out of the box - no JSON file to write, no big multi-purpose node pack to install just to get a size picker.

    How it works

    aspect_ratio narrows the list to a family (the pack documents 1:1, 4:5, 3:4, 2:3, 7:10, 5:8, 7:12, 9:16, 1:1.85, 1:2, 9:21, 1:3, and a few more beyond that). resolution then picks the actual width-by-height pair sized for that ratio, from a list the author maintains and updates independently on GitHub - so the exact numbers can shift a little between pack versions. batch_size stacks copies in the output batch, same as any standard empty-latent node.

    Inputs and outputs that matter

    • aspect_ratio - which ratio family to draw from.
    • resolution (default 512x512) - the specific size within that family.
    • swap_orientation (enable/disable, default disable) - flips width and height without re-picking.
    • batch_size (1–10, default 1) - how many empty latents to generate at once.

    Three outputs: Latent, ready to wire into a KSampler; and Width / Height as plain INTs, for anything that needs the raw numbers rather than an opaque latent tensor.

    Installing it

    ComfyUI Manager: search mzmaxam in Custom Nodes Manager and install. Or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/MzMaXaM/ComfyUi-MzMaXaM
    

    Restart ComfyUI. Nothing to download - pure node logic, no dependencies. The pack also ships a couple of example workflows: in ComfyUI, open Workflow → Browse Templates, and look for the comfyui-mzmaxam category.

    Where people get tripped up

    With 148 resolution entries, the dropdown is long - pick aspect_ratio first, it's what keeps the resolution list navigable rather than an unsorted wall of numbers. Second, batch_size isn't free: pushing it up multiplies your VRAM use and sampling time linearly, it doesn't make anything better, just more of it. Third, this node is dropdown-only - if the size you actually want isn't on the list and a version bump hasn't added it yet, you're back to ComfyUI's stock Empty Latent Image node with manually typed numbers. And a general reminder that applies to any resolution picker: the size you choose should sit near what your checkpoint was actually trained on. Off-ratio, off-scale generations are the classic source of duplicated limbs and stretched anatomy - the point of a curated list like this one is to keep you inside sane territory in the first place.

    CategoryMzMaXaM

    Inputs (4)

    NameTypeDefaultDescription
    aspect_ratioCOMBO1:1 Square Format16 options: 1:1 Square Format, 4:5 Portrait Photography, 3:4 Retro CRT TV & Monitor, 2:3 Standard Photography, 7:10 Trading Cards of all sorts, 5:8 Expanded Portrait, +10
    resolutionCOMBO512x512148 options: 512x512, 576x576, 640x640, 704x704, 768x768, 832x832, +142
    swap_orientationCOMBOdisable2 options: enable, disable
    batch_sizeINT11–10

    Outputs (3)

    NameTypeDescription
    LatentLATENTEmpty Latent. Width and Height of selected size.
    WidthINT
    HeightINT