Resolution Selector
Stop doing Empty Latent math by hand — let it work the megapixels for you
- width
- height
Every ComfyUI workflow starts the same way: you type 1024 into the Empty Latent Image node and hope it's a good size. Then you change your mind, want a portrait, and now you're doing mental math to find an aspect ratio that doesn't blow up your VRAM. The Resolution Selector is the built-in answer to that: you tell it an aspect ratio and a megapixel target, and it hands you a width and height to plug straight into Empty Latent.
It ships with ComfyUI core - nothing to install - and it's new, landing in 2026. If you're on an up-to-date ComfyUI it's in the default node menu already.
How it actually works
The clever bit is that resolution doesn't scale linearly. Doubling the megapixels doesn't mean doubling each side - area grows with the square, so a 2 MP image is only ~1.41x each dimension. The node does the real math for you: it takes the total pixel count (megapixels × 1,048,576), divides by the aspect ratio's width×height product, square-roots the result to get a scale factor, then rounds width and height to the nearest multiple you choose.
That last step matters more than it looks. It's the difference between a working image and a "latent shape not divisible by 8" error. The node's default multiple is 8, which clears the base requirement; if your model needs more (Flux-family models want multiples of 64), just crank the multiple input up.
The inputs that matter
Only three, and you'll touch two of them:
- aspect_ratio - a dropdown with the sensible presets: 1:1 square, 2:3 and 3:4 portrait, 3:2 and 4:3 landscape, 9:16 and 16:9 widescreen, plus 21:9 ultrawide. No custom ratios, but honestly the presets cover every real use.
- megapixels - the target total, 0.1 to 16 with a default of 1.0. That default is deliberate: 1.0 MP ≈ 1024×1024, the training resolution of the whole SDXL generation.
- multiple - the rounding grid, 8 to 128. Leave it at 8 unless you know your model demands more.
Outputs are just width and height as plain integers. Wire both into an Empty Latent Image and you're done. That's the whole node.
Where people get burned
The biggest trap is treating megapixels like a free lunch. Cranking the target to 8 or 16 MP doesn't give you a better image on most models - it gives you VRAM exhaustion and, on models with a native-resolution band, soft degradation or repeated patterns. The community's standing advice is to generate at your model's native resolution (roughly 1–2 MP for the current crop of models) and upscale afterward. This node is for picking the right size, not the biggest one.
Second trap: it rounds down to your multiple, so you might get a hair under your target. That's fine - nobody can see 1.98 vs 2.0 MP, and being on the multiple is worth more than the few missing pixels.
Third: the aspect ratios are listed as ratios, not pixels. 16:9 at 1 MP does not mean 1920×1080 - it means a 16:9 image with about a million pixels total, which comes out around 1368×768 after rounding. If you need literal 1080p, this isn't the node for that; it's for latent-generation sizes, not display sizes.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| aspect_ratio | COMBO | 1:1 (Square) | The aspect ratio for the output dimensions. |
| megapixels | FLOAT | 1.00.1–16 | Target total megapixels. 1.0 MP ≈ 1024x1024 for square. |
| multiple | INT | 88–128 | Nearest multiple of the result to set the selected resolution to. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| width | INT | Calculated width in pixels multiplied by the selected multiple. |
| height | INT | Calculated height in pixels multiplied by the selected multiple. |