Nodes/ComfyUI SKBundle/Advanced Aspect Ratio
ComfyUI Node

Advanced Aspect Ratio

Advanced Aspect Ratio (SKBundle)

By SKBv0·Created 2 years ago·Updated 3 months ago· 125
Advanced Aspect Ratio
    • width
    • height
    • upscale_factor
    category
    subcategoryCustom
    width512
    height512
    swap_dimensionsfalse
    upscale_factor1.00
    round_to_64false

    Advanced Aspect Ratio is a width/height calculator that sits at the front of your graph, before the sampler ever sees a number. Instead of typing 1024 and 1536 into an Empty Latent Image node and hoping you did the math right, you pick a category and let this node hand back clean, correctly-rounded dimensions.

    Why you'd reach for it

    Getting resolution wrong is one of the more common ways a generation goes bad - go too far off a model's native training resolution and you get duplicated limbs, tiling, or straight-up garbled output. SDXL wants specific trained ratios, Flux wants dimensions divisible by 64, and everyone's typed a width or height by hand at some point that wasn't actually a clean multiple of anything. This node exists to take that arithmetic off your plate: pick a category, get a sane pair of numbers back, and stop guessing whether 1368 is going to cause you a headache three steps later.

    How it works

    You start with category - Custom, Print, Social Media, Cinema, or Flux - which frames what kind of output you're targeting, and subcategory, a text field that narrows the preset within that category. From there, width and height are your base numbers (default 512×512, adjustable from 32 up to 8192 in steps of 8), swap_dimensions flips them for a quick portrait/landscape toggle without retyping anything, and upscale_factor (0.1 to 4, in 0.05 steps) is a multiplier that rides along as its own output - the idea being you set your base generation size here and feed the same multiplier into a downstream upscale node, rather than typing the target resolution twice and having the two drift out of sync.

    The one that actually matters most if you're on Flux: round_to_64. Flux's usable dimensions need to be divisible by 64 - that's not a soft recommendation, it's the model's actual constraint - and this toggle snaps whatever you've dialed in to the nearest valid multiple. It defaults to off, so picking Flux as your category doesn't automatically protect you; you still need to flip this switch yourself.

    Inputs and outputs

    The settings you'll actually touch are category (what kind of preset you're working from), width / height (your base numbers), and round_to_64 (turn it on for Flux, ignore it for anything with looser constraints). Three outputs: width and height as plain integers, and upscale_factor as a float - wire width/height into your latent or empty-image node, and upscale_factor into whatever upscaler you're chaining afterward.

    Installing it

    Part of ComfyUI SKBundle, the personal node pack from u/skbphy (GitHub: SKBv0) - built with Cursor AI's help by someone who's been open about not being a professional programmer, with rgthree and mxToolkit cited as the influence. Through ComfyUI Manager, search ComfyUI SKBundle. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/SKBv0/ComfyUI_SKBundle.git
    pip install -r requirements.txt
    

    Restart ComfyUI afterward. Nothing to download beyond the pack itself - this is arithmetic, not inference.

    Common issues

    The one mistake worth calling out twice: round_to_64 is off by default. If you're generating on Flux and you leave it off, you can still end up with a width or height that isn't a valid multiple, even though you picked the "Flux" category - the category label doesn't enforce the constraint on its own. Turn the toggle on whenever you're targeting Flux and let it do the rounding for you.

    Past that, remember upscale_factor is a passthrough number, not something this node applies to width/height for you - if you want the scaled resolution as a number, you're expected to feed the factor into your upscale node rather than expecting the base width/height outputs to already reflect it. And because subcategory is a free-text field rather than a fixed dropdown in the schema, don't be surprised if it behaves differently than you expect depending on what the category picker populates it with - when in doubt, drop the node and look at what's actually offered before assuming a preset name.

    CategorySKB/display

    Inputs (7)

    NameTypeDefaultDescription
    categoryCOMBO5 options: Custom, Print, Social Media, Cinema, Flux
    subcategorySTRINGCustom
    widthINT51232–8192
    heightINT51232–8192
    swap_dimensionsBOOLEANfalse
    upscale_factorFLOAT1.000.1–4
    round_to_64BOOLEANfalse

    Outputs (3)

    NameTypeDescription
    widthINT
    heightINT
    upscale_factorFLOAT