Nodes/comfyui-resolution-selector/Resolution Selector (MP + Ratio)
ComfyUI Node

Resolution Selector (MP + Ratio)

Selects the resolution closest to the requested megapixels and aspect ratio, snapped to a multiple. Outputs an empty latent, width/height, and the input image resized (lanczos) and center-cropped to fit.

By speedyrulz·Created about a month ago·Updated about a month ago· 0
Resolution Selector (MP + Ratio)
  • image
  • latent
  • width
  • height
  • image
megapixels1.05
aspect_width3
aspect_height4
multiple32
use_imagefalse
use_image_ratiofalse
latent_typeFlux / SD3
Categoryutils/resolution

Inputs (8)

NameTypeDefaultDescription
megapixelsFLOAT1.050.01–64Target size in megapixels, e.g. 4.15
aspect_widthINT31–8192Aspect ratio width term (e.g. 16 in 16:9)
aspect_heightINT41–8192Aspect ratio height term (e.g. 9 in 16:9)
multipleINT321–1024Each edge is snapped to a multiple of this
use_imageBOOLEANfalseOff = ignore the input image entirely
use_image_ratioBOOLEANfalseUse the input image's aspect ratio instead of aspect_width / aspect_height
latent_typeCOMBOFlux / SD3Latent channel format for the empty latent
imageoptIMAGE

Outputs (4)

NameTypeDescription
latentLATENT
widthINT
heightINT
imageIMAGE