Nodes/ComfyUI-3R3BOS-Pack/Aspect Ratio Master
ComfyUI Node

Aspect Ratio Master

The resolution calculator that knows your model's VAE

By 3R3BOS·Created 8 months ago·Updated about a month ago· 10
Aspect Ratio Master
    • width
    • height
    • empty_latent
    • preview
    use_custom_ratiofalse
    custom_width1024
    custom_height1024
    model_archWan Video (V2.x/V2.5)
    performance_modeMiddle Quality
    aspect_ratio16:9 (Cinematic)
    use_batchfalse
    batch_size1
    custom_scale_factor1.00

    Every model has a native resolution, and the newer ones are picky about more than megapixels: Flux wants 16 latent channels, Mochi wants 12, SANA wants 32, LTX Video wants 128 - and if the empty latent you feed a sampler has the wrong channel count, the VAE decode at the end crashes or spits out a grey mess. Aspect Ratio Master is the node that keeps you from having to remember any of that. It picks a resolution, and hands you an empty latent already shaped for your exact architecture. That second part is the whole point.

    It's from the 3R3BOS Pack, a small solo pack. This node is genuinely useful, though it has a bit of a stormy past: v1.0.8's changelog is essentially a confession that latent channels were hardcoded to 4 for every architecture, which broke VAE decoding for Flux, Wan, SD3 and friends. That's fixed now - but it's a good reminder to actually update the pack rather than assume you're on the latest.

    How it works

    Under the hood it's a small lookup table and a bit of arithmetic. Each architecture gets three numbers: a round-to multiple (mod 8/16/32/64 so dims stay VAE-friendly), a VAE compression factor (how much the latent is downsampled per side), and the latent channel count. The quality mode picks a megapixel budget from a preset table, the aspect ratio splits that budget into width and height, and then everything is snapped to the rounding multiple.

    The clever output is the empty latent itself:

    torch.zeros([batch_size, latent_channels, h // vae_factor, w // vae_factor])
    

    That's the exact shape the sampler expects, generated for you - no separate Empty Latent Image node, no "wait, which divisible-by number does this model want" guessing. A small preview image is rendered too, so you see your dimensions and a visual of the frame before you queue anything.

    Inputs and outputs

    The ones you'll actually set:

    • model_arch - the picker with ~24 entries: Flux, Wan Video (V2.x/V2.5), NVIDIA Cosmos, SANA-1.5, Hunyuan Video/Image, LTX Video, SDXL, Pony, Illustrious/NoobAI, and more. This drives everything, so get it right.
    • aspect_ratio - 13 presets from 1:1 to 21:9 and 1:2.
    • performance_mode - Low / Middle / High Quality, which just shifts the megapixel budget up and down.

    The extras: use_custom_ratio flips on CUSTOM mode with custom_width/custom_height integer fields (auto-snapped to safe multiples), use_batch + batch_size make a multi-frame latent for video or batch work, and custom_scale_factor (0.5–2.0) scales the whole budget up or down.

    Outputs: width and height as ints, empty_latent (LATENT) to feed the KSampler, and preview (IMAGE) so you can eyeball the frame.

    Installing it

    Part of the pack - no model files, no extra Python dependencies. Via Manager, search 3R3BOS Pack, install, restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/3R3BOS/ComfyUI-3R3BOS-Pack
    

    then restart ComfyUI. comfy node install 3r3bos-pack works too.

    Where people get burned

    Three things. First, update the pack - the channel-count bug I mentioned above caused real crashes, and if you were seeing grey outputs or VAE decode errors on a modern model, that fix is probably yours. Second, trust the architecture presets over custom dims; if you go custom, remember the node locks minimums at 380x680 so you can't accidentally generate a latent so small it's useless. Third, this is a 2026-era calculator for a fast-moving model zoo - the preset table is the author's best guess at architectures that change quarterly. For a wildly new model, the safe habit is still to check the model card before trusting any calculator, this one included.

    Category3R3BOS/Utils

    Inputs (9)

    NameTypeDefaultDescription
    use_custom_ratioBOOLEANfalse
    custom_widthINT102464–8192
    custom_heightINT102464–8192
    model_archCOMBOWan Video (V2.x/V2.5)24 options: Wan Video (V2.x/V2.5), Flux.1 / Flux.2 [Klein], Z-Image Family (Base/Turbo/Edit), NVIDIA Cosmos (Gen/Predict), Aura Flow, CogVideoX, +18
    performance_modeCOMBOMiddle Quality3 options: Low Quality, Middle Quality, High Quality
    aspect_ratioCOMBO16:9 (Cinematic)13 options: 1:1 (Square), 4:3 (Photo), 3:4 (Portrait), 16:9 (Cinematic), 9:16 (Stories), 21:9 (Ultrawide), +7
    use_batchBOOLEANfalse
    batch_sizeINT11–64
    custom_scale_factorFLOAT1.000.5–2

    Outputs (4)

    NameTypeDescription
    widthINT
    heightINT
    empty_latentLATENT
    previewIMAGE