Best-Res (area+scale)

BestResolutionFromAreaUpscale

Best Resolutionoutput node

The most efficient way of selecting an optimal resolution: image size selected indirectly - by the total desired resolution (area) + aspect ratio... ... PLUS, account for the immediate upscale right away. Desired resolution (aka image area/megapixels/pixel count) is specified with a side of a square image. This isn't accidental: most models disclose what image resolution they're trained on, and usually they're square: - SD 1.5 - 512x512 pixels - SDXL - 1024x1024 pixels By simply providing this single number and setting your aspect ratio/orientation, you get the width and height to produce the closest total resolution to the training set, while also respecting image proportions and step-rounding.

Pack: Best Resolution

custom_nodes.ComfyUI-BestResolution

Inputs (8)

NameTypeRequired
square_sizeINTrequired
stepINTrequired
landscapeBOOLEANrequired
aspect_aFLOATrequired
aspect_bFLOATrequired
priorityCOMBOrequired
upscaleFLOATrequired
HD_stepINTrequired

Outputs (5)

NameType
upscaleFLOAT
init_widthINT
init_heightINT
HD_widthINT
HD_heightINT