Extensions/comfyui-resolution-selector
ComfyUI Extension

comfyui-resolution-selector

Pick a megapixel budget and aspect ratio; get the closest usable resolution.

By speedyrulz·Created about a month ago·Updated about a month ago· 0
speedyrulz/comfyui-resolution-selector
Nodes
On cloudLocal install
Stars0
Updatedabout a month ago
Readme

<<<<<<< HEAD

ComfyUI Resolution Selector

Pick a megapixel budget and aspect ratio; get the closest usable resolution. Node: Resolution Selector (MP + Ratio) under utils/resolution.

Install

Copy the comfyui-resolution-selector folder into ComfyUI/custom_nodes/ and restart ComfyUI (refresh the browser too, for the live preview script).

Widgets

| Widget | Type | Purpose | |---|---|---| | megapixels | FLOAT (0.01 steps) | Target size, e.g. 4.15 | | aspect_width / aspect_height | INT | Ratio terms, e.g. 16 : 9 | | multiple | INT | Each edge snaps to a multiple of this | | use_image | toggle | Off = input image ignored entirely | | use_image_ratio | toggle | Use the input image's ratio instead of the ratio widgets | | latent_type | dropdown | SD/SDXL (4ch) or Flux/SD3 (16ch) empty latent |

Inputs / Outputs (all optional)

  • image (in): optional image to resize.
  • latent: empty latent at the generated resolution.
  • width / height: generated resolution as INTs.
  • image (out): input image lanczos-resized to cover the target, then center-cropped to fit exactly. None if no image was provided or use_image is off (don't leave it connected in that case).

Behavior

  • The chosen width/height minimize combined megapixel + aspect-ratio error on the multiple grid, never below multiple per edge.
  • The generated resolution is shown live at the bottom of the node as you change values. With use_image_ratio on and an image connected, it shows "resolved at runtime" since image dimensions are only known then.
  • Latent is size/8 per side; with multiple below 8 the latent rounds down, so keep multiple at 8+ for exact latent match. =======

comfyui-resolution-selector

eb835d85f901d0900fd87c372f9cbf43f5d60dfe