Nodes/ComfyUI-Minitools/Aspect Ratio Selector 👻
ComfyUI Node

Aspect Ratio Selector 👻

A dropdown that hands you a latent, width and height — no calculator required

By lepiai·Created 2 years ago·Updated 13 days ago· 10
Aspect Ratio Selector 👻
    • latent
    • width
    • height
    aspect_ratio1:1(1328, 1328)
    batch_size1

    The normal way to start a workflow is to plonk down an EmptyLatentImage and type the width and height yourself. This node is the lazy version: pick "16:9" from a dropdown and it hands you a ready latent and the matching width and height as separate INT outputs. No typing, no division-by-8 in your head, no "wait, is 1328×1328 divisible by 8?"

    It ships in ComfyUI-Minitools (look for the "Aspect Ratio Selector 👻" node, the ghost is the pack's signature), a grab-bag of small utilities from a Chinese author who mostly targets the MiniMax H3 video workflow. That context matters, because the dimensions on offer are not the usual SDXL resolution ladder.

    What you get

    Seven presets, each named for its aspect ratio with the pixel dimensions baked into the label:

    • 1:1(1328, 1328), 16:9(1664, 928), 9:16(928, 1664), 4:3(1472, 1140), 3:4(1140, 1472), 3:2(1584, 1056), 2:3(1056, 1584)

    The author clearly tuned these for the video workflow this pack orbits (the batch_size tooltip gives that away), so if you're driving an H3 sampler with it, great. If you're generating SDXL or Flux, you're probably better off with the stock aspect-ratio set your model was trained on - the latent you get here is just a zeroed tensor, so the node works anywhere, but 1328×1328 isn't an SDXL training resolution and you'll notice.

    Two inputs, both of which you'll actually touch:

    • aspect_ratio - the dropdown. Defaults to 1:1.
    • batch_size - the tooltip calls it "number of samples in the latent batch (controls execution count)", which is a hint at its real job. In an H3-style video workflow, batch size here means how many clips you're generating in one pass, so leave it at 1 unless you know your downstream node consumes a batch.

    How it works

    Under the hood it's exactly what a well-behaved EmptyLatentImage replacement should be: it looks the ratio up in a hardcoded width/height map, divides both by 8 to get the latent size (that's the standard VAE 8× downsampling - see the KB's notes on resolution and latent space), and allocates a 4-channel zero tensor on ComfyUI's compute device.

    The outputs are the payoff:

    • latent (LATENT) - wire this straight into your sampler.
    • width / height (INT) - wire these into anything that wants the pixel dimensions, like a latent-to-size node or a caption writer, so the number always matches what's actually in the latent. That's the real point of this node over a manual latent: one source of truth for the numbers.

    Install

    # ComfyUI Manager: search "ComfyUI-Minitools" in the Install Custom Nodes tab
    # or manually:
    cd ComfyUI/custom_nodes
    git clone https://github.com/lepiai/ComfyUI-Minitools
    # restart ComfyUI
    

    No model files, no extra keys - the whole pack's pip deps are just openai, requests, Pillow and numpy, and this node in particular needs none of them beyond what ComfyUI already ships. It's the simplest node in the pack and probably the one you'll reuse most.

    Gotchas

    • The dimensions are H3-flavored, not universal. If your sampler complains about non-ideal resolutions, that's why.
    • batch_size up to 4096 is allowed by the UI. A latent batch that big is a memory bomb on most GPUs. Keep it small.
    • This pack has essentially no community footprint - the README is in Chinese and barely mentions the newer nodes at all, so the source code is the only real documentation. What I've described here is straight from the code, so it's accurate, but don't expect a support thread to exist.

    It's a small node. It saves you one text box and one math step per workflow, and when you're building video pipelines with five aspect presets side by side, that adds up.

    CategoryMiniTools

    Inputs (2)

    NameTypeDefaultDescription
    aspect_ratioCOMBO1:1(1328, 1328)Select an aspect ratio to get corresponding dimensions and latent
    batch_sizeINT11–4096Number of samples in the latent batch (controls execution count)

    Outputs (3)

    NameTypeDescription
    latentLATENT
    widthINT
    heightINT