Nodes/Klinter_nodes/Aspect Ratio Selector - klinter
ComfyUI Node

Aspect Ratio Selector - klinter

Stop typing resolutions by hand — this node does the math for you

By klinter007·Created 3 years ago·Updated 9 months ago· 19
Aspect Ratio Selector - klinter
    • width
    • height
    • name
    base_resolution1536
    aspect_ratio
    seed0

    Aspect Ratio Selector - klinter is the node you grab when you're tired of hand-typing 1216x832 into an Empty Latent and praying it's a valid size for the checkpoint. You pick an aspect ratio and a base resolution, and it hands you back the width, height, and a label. That's the whole job, and honestly it's a good one - resolution management is one of those little chores that eats minutes out of every workflow session.

    The mechanism is straightforward, but it has one opinion worth knowing about. You choose a base resolution (512 up to 1536, default 1536) and a ratio like 16:9 or 9:16. The node holds a table of ratios with their relative proportions, computes dimensions so the smaller side equals the base resolution, and rounds everything to even numbers. So base 1024 at 16:9 gives you a landscape canvas where the short edge is 1024. That "smaller side is the base" choice is the sensible one for most models, since the short edge is what typically governs whether you blow past native training resolution.

    There's a hidden feature buried in the seed input that's easy to miss: leave it at 0 and nothing happens, but set any nonzero seed and the node randomly picks an aspect ratio for you, seeded so it's reproducible. That's a neat trick for batch-variation workflows where you want a shuffled set of orientations, though you'll usually keep it at 0. The name output is just a string of the ratio you picked - handy for logging or for feeding into a workflow-level filename.

    The inputs that matter are only two: base_resolution and aspect_ratio, both dropdowns. Outputs are width, height (INT) and name (STRING). Wire width and height into an Empty Latent (or a size input on whatever sampler pipeline you run), and you're done.

    Installing is the standard drill for this pack: either search "Klinter_nodes" in ComfyUI Manager, or cd ComfyUI/custom_nodes && git clone https://github.com/klinter007/klinter_nodes and restart. The repo has no requirements.txt - this node only needs torch and the comfy_api module that ships with current ComfyUI builds. One gotcha specific to this pack: it's written against the newer io.ComfyNode API, so if the nodes don't show up after install, update ComfyUI itself rather than the pack.

    It's a simple utility and that's the point. Don't expect drama, expect saved time.

    Categoryklinter

    Inputs (3)

    NameTypeDefaultDescription
    base_resolutionCOMBO15367 options: 512, 768, 1024, 1152, 1280, 1408, +1
    aspect_ratioCOMBO12 options: 1:1, ---, 3:2, 5:4, 8:5, 16:9, +6
    seedINT00–18446744073709550000

    Outputs (3)

    NameTypeDescription
    widthINT
    heightINT
    nameSTRING