Resolution Selector Extended
Pick an aspect ratio, dial megapixels, get clean multiples
- width
- height
The most annoying thing about resolution in ComfyUI is the arithmetic. "16:9 at 1 megapixel" is not a number you know off the top of your head, and if you type a non-multiple-of-8 dimension you're asking for a model that was trained at specific sizes to behave itself anyway. Resolution Selector Extended from the Diztraido pack does the thinking for you: pick an aspect ratio from a 23-option list, set a megapixel target, and it returns width and height as two clean ints, rounded to the alignment multiple you choose. Set the ratio once, drag the megapixel slider around, and your Empty Latent always gets a sane number.
It's a utility, not a model thing - it's just math with a frontend. If you've used the "choose resolution" style nodes in other packs, you know the shape; this one just has a genuinely wide ratio list, from the standard 16:9 and 1:1 up to panoramics like 3:1 and 1:3, plus a Custom mode where your exact width/height win.
How it works
The math is straightforward: given an aspect ratio (as a width:height pair), a megapixel target, and an alignment multiple, it computes total_pixels = megapixels × 1024 × 1024, scales the ratio so the area matches, then rounds both dimensions to the nearest multiple of multiple. So 1.0 MP at 16:9 gives you 1366×768-ish, cleaned up to a multiple of 8 (1368×768). In Custom mode it skips all of that and returns width/height as-is, clamped to sane bounds. The frontend extension even previews the computed resolution live as you tweak the widgets.
The inputs that matter
aspect_ratio- 23 named presets plusCustom. "1:1 (Square)", "16:9 (Widescreen)", "2:3 (Portrait Photo)", "21:9 (Ultrawide)", panoramics, and more.megapixels- 0.1 to 16, default 1.0. 1.0 is the classic 1024² sweet spot for most models; Flux.2 and Klein can push higher.multiple- the alignment multiple, default 8, up to 128. 8 is right for most models; some quantizations like 16 or 32.width/height- only consulted inCustommode (both default 1024, range 8–16384, stepped by 8).
Outputs: width and height as INTs, ready for an Empty Latent Image, this pack's Flux Sampler, a KSampler's latent, or a Latent Upscale.
How to install
Part of Diztraido Nodes. ComfyUI Manager → search "Diztraido Nodes" → install diztraido-nodes → restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/jadervasque/ComyUI-Diztraido.git
Restart and it's under the Diztraido utils category. No dependencies, no models - it's pure arithmetic.
Common issues
The main confusion is Custom mode: if you've set aspect_ratio to anything other than Custom, editing width/height does nothing, because they're not consulted. People change width, see no change, and assume it's broken - it's the mode selector. Also keep the alignment habit: even though the node guarantees multiples of multiple, if you pair this with a model whose training resolution is a specific multiple, stick to the multiple (usually 8) that matches, and don't go to extreme megapixels on a model that wasn't trained for it - 1.0–1.5 MP is the sensible band for most, with Flux.2/Klein being the ones that genuinely handle more.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| aspect_ratio | COMBO | 1:1 (Square) | 23 options: 1:1 (Square), 2:3 (Portrait Photo), 3:2 (Photo), 3:4 (Portrait Standard), 4:3 (Standard), 9:16 (Portrait Widescreen), +17 |
| megapixels | FLOAT | 1.00.1–16 | — |
| multiple | INT | 88–128 | — |
| width | INT | 10248–16384 | — |
| height | INT | 10248–16384 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| width | INT | — |
| height | INT | — |