Nodes/Best Resolution/Best-Res (ratio)
ComfyUI Node

Best-Res (ratio)

A more advanced node for easier selection of an optimal resolution: image size selected indirectly - by one of the sides + aspect ratio.

By Lex-DRL·Created about a year ago·Updated 4 months ago· 14
Best-Res (ratio)
    • width
    • height
    size1024
    step48
    size_is_bigtrue
    landscapetrue
    aspect_a16
    aspect_b9
    CategoryBest Resolution

    Inputs (6)

    NameTypeDefaultDescription
    sizeINT10241–9223372036854776000Approximate size of one of the image sides. Which one - see the 'size_is_big' and 'landscape' toggles.
    stepINT481–9223372036854776000Both width and height will be divisible by this value - by rounding them to the closest appropriate resolution. The default 48 is (8 * 3 * 2), so it's a safe choice because: - it's compatible with SD1.5/XL downsampling factor (divisible by 8), - it can be upscaled by x1.5 or x1.333 at the first iteration, which is optimal for latent-upscale, - after x1.5 upscale, if you only do x2 later (it's OK for already high resolutions) - it will be divisible by 3 AND 9, which might become handy at that point, where you'll probably use UltimateSDUpscale. Other values worth trying first: 64, 96, 128.
    size_is_bigBOOLEANtrueWhen ON, size parameter represents the bigger image side. When OFF, it specifies the smaller one.
    landscapeBOOLEANtrueSpecifies image orientation: When ON, width is bigger (image is horizontal). When OFF, height is bigger (image is vertical).
    aspect_aFLOAT16Two aspects together define an aspect ratio (16:9, 4:3, etc). Order doesn't matter: image orientation is defined by the 'landscape' toggle. The specified aspect ratio is APPROXIMATE: step parameter has priority over the exact image proportions.
    aspect_bFLOAT9Two aspects together define an aspect ratio (16:9, 4:3, etc). Order doesn't matter: image orientation is defined by the 'landscape' toggle. The specified aspect ratio is APPROXIMATE: step parameter has priority over the exact image proportions.

    Outputs (2)

    NameTypeDescription
    widthINT
    heightINT