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

BSZ Absolute Hi Res

Hi-res fix sizes, calculated instead of guessed

By Beinsezii·Created 3 years ago·Updated 2 years ago· 27
BSZ Absolute Hi Res
    • Lo Res Width
    • Lo Res Height
    • Hi Res Width
    • Hi Res Height
    base_model_res1024
    desired_width1536
    desired_height1536

    Hi-res fix has a dumb little math problem nobody wants to do by hand: your first pass should run at roughly your model's native resolution, and your second pass at whatever you actually want, and the two have to share an aspect ratio or you get distortion. BSZ Absolute Hi Res just does that arithmetic for you.

    Why you'd reach for it

    If you're building a hires-fix workflow the classic way - Empty Latent for pass one, latent upscale, KSampler at low denoise for pass two - you've been typing in four numbers that are secretly related. Change the target size and you have to re-derive the first pass. This node turns that into: tell it your model's resolution and your desired final size, and it hands back all four.

    The author's framing is worth knowing: "auto hires" is a utility in a pack whose workflows are built around chained single-stage nodes - because in ComfyUI's caching model, a single all-in-one hires node re-runs everything when you touch the second stage, whereas chained nodes only re-run what changed. This is the part that computes the sizes; the actual upscaling is still normal ComfyUI nodes.

    How it works

    Give it three integers:

    • base_model_res - native resolution of your model. The README is explicit: SD 1.5 ≈ 512, SD 2.1 ≈ 768, SDXL ≈ 1024.
    • desired_width and desired_height - the final image size you want.

    It computes the low-res pass at roughly base_model_res² megapixels (keeping your target's aspect ratio), then outputs four ints:

    • Lo Res Width / Lo Res Height - wire into your first-pass Empty Latent.
    • Hi Res Width / Hi Res Height - the final size, for the upscale and second pass.

    Everything is rounded to multiples of 8, which is what the VAE expects, so you won't get the "latent size not divisible by 8" error this is meant to prevent.

    Install

    It's one of the auto-hires trio in Beinsezii's bsz-cui-extras:

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

    restart ComfyUI, or grab it from ComfyUI Manager by searching "bsz-cui-extras". No extra dependencies, no model files.

    Notes

    The README makes a point of warning about its sibling BSZAspectHires: if you scale both axes by 2.0 you quadruple the pixels. This node has no such footgun - the low-res pass is always pinned near native resolution regardless of how big you ask for the final image, which is exactly what makes it a safe default for absolute sizing. Set base_model_res once per model family and forget it.

    Categorybeinsezii/utils

    Inputs (3)

    NameTypeDefaultDescription
    base_model_resINT10248–4096
    desired_widthINT15368–4096
    desired_heightINT15368–4096

    Outputs (4)

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