Nodes/bsz-cui-extras/BSZ Aspect Hi Res
ComfyUI Node

BSZ Aspect Hi Res

Set your hires target by aspect ratio instead of pixels

By Beinsezii·Created 3 years ago·Updated 2 years ago· 27
BSZ Aspect Hi Res
    • Lo Res Width
    • Lo Res Height
    • Hi Res Width
    • Hi Res Height
    base_model_res1024
    desired_aspect_x3
    desired_aspect_y2
    scale1.5

    Sometimes you don't care about the exact pixel count - you care that the image is 3:2, or that it's "1.5x bigger" than what a 1024² model naturally makes. BSZ Aspect Hi Res is the hires-fix calculator for that mindset: you feed it an aspect ratio and a scale factor, and it hands you a full low-res/high-res size pair.

    Why you'd reach for it

    The sibling node, BSZ Absolute Hi Res, is for "I want exactly 1536×1024." This one is for "I want a landscape shape, and I want the second pass to be 1.5x the first." If you swap models or aspect ratios often, expressing the target as a ratio instead of absolute pixels survives the swap without touching the graph.

    How it works

    Three inputs do everything:

    • base_model_res - native resolution of your model (SD 1.5 ≈ 512, SD 2.1 ≈ 768, SDXL ≈ 1024).
    • desired_aspect_x / desired_aspect_y - the target shape, as a horizontal/vertical pair. Defaults are 3.0 and 2.0, i.e. 3:2.
    • scale - how much bigger the hi-res pass is than the low-res pass. Default 1.5.

    It computes the low-res pass at roughly base_model_res² megapixels with your chosen aspect, then scales both axes by scale for the hi-res pass. Outputs are the same four ints as the rest of the family: Lo Res Width, Lo Res Height, Hi Res Width, Hi Res Height, all rounded to multiples of 8.

    The README's explicit warning: scale multiplies both axes, so 2.0 doesn't double the pixel count - it quadruples it. "Use with care," says the author, and they mean it. A 2x scale on an SDXL low-res pass puts you in 4k territory and straight into memory problems on a mid-range card. 1.5 is a sensible place to live.

    Install

    Part of Beinsezii's bsz-cui-extras:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Beinsezii/bsz-cui-extras
    

    then restart, or install via ComfyUI Manager searching "bsz-cui-extras". Pure Python, no requirements.

    Gotchas

    The aspect inputs are a ratio, not "width and height." If you want portrait, put the larger number in desired_aspect_y. And because the low-res pass is pegged to base_model_res, the actual output size is whatever the ratio lands on - this node sizes to the aspect, not to a fixed megapixel target, so check the Hi Res Width/Height outputs before you wire them into a node with a hard resolution limit. If you'd rather give it a concrete final size and let it handle the ratio, use BSZ Absolute Hi Res instead.

    Categorybeinsezii/utils

    Inputs (4)

    NameTypeDefaultDescription
    base_model_resINT10248–4096
    desired_aspect_xFLOAT30.1–100
    desired_aspect_yFLOAT20.1–100
    scaleFLOAT1.50.1–10

    Outputs (4)

    NameTypeDescription
    Lo Res WidthINT
    Lo Res HeightINT
    Hi Res WidthINT
    Hi Res HeightINT