yaResolution Selector
Stop Googling Aspect Ratios — This Node Prewires Itself to Your Latent
- width
- height
Every ComfyUI workflow starts with the same chore: add an Empty Latent Image and hand-type width and height. You know you want 16:9, but you can't remember whether 1344x768 is landscape or portrait, and 1216x832 feels like a number you should have memorized by now. YARS - "Yet Another Resolution Selector" - exists to retire that chore.
The name is a joke and it's also honest. This is a plain resolution-selector node, nothing more: pick a base resolution and an aspect ratio, and it spits out clean width and height integers. No models, no API, no key, no dependencies. Pure Python stdlib. It's the kind of node you forget is even installed until you build a workflow without it and remember why you installed it.
The one trick that makes it worth installing
Loads of packs ship a resolution dropdown. What sets YARS apart is that it wires itself up. Right-click on an Empty Latent Image (or an ImageScale or LatentUpscale node) and you get two new menu entries: Prepend yaResolution Selector and Prepend Advanced yaResolution Selector. Pick the basic one and the node appears to the left, its width and height outputs already connected to the latent's width/height widgets - which the extension quietly converts from widgets into linked inputs. Change a preset and your latent follows. No typing, no dragging wires, no remembering whether that ratio was 1152x896 or the other way round.
How it works
There are three inputs that matter:
- base_resolution - should match your model's native resolution: 512 for SD 1.5, 1024 for SDXL and most modern models. Step of 128, minimum 512.
- aspect_ratio - a dropdown of 13 presets (1:1, the landscape 5:4 through 21:9 set, and their portrait mirrors).
- overextend - the knob everyone trips on. Off by default, which means the longer side gets capped at
base_resolution: 16:9 at a 512 base gives you 512x288. Flip it on and the base becomes the short side instead, so the long side grows: same input becomes 910x512. The README's own example is 2:1 at 512 → 512x256 normally, 1024x512 overextended (the README writes that example with the dimensions swapped - the node's the one to trust).
Outputs are exactly two: width and height, both INT, both snapped to even numbers (anything under 64px raises an error instead of silently producing garbage). Wire them into the Empty Latent, or feed them to an ImageScale for a consistent upscale target. After each run the node also prints a small readout showing the actual resolution, megapixel count, and ratio - handy when you're budgeting VRAM.
Presets are just a text file
The dropdown is read from a ratios.txt sitting next to the node's code. Use the node once and it creates the file with the defaults; open it, add your own lines in width:height format - whole numbers and a colon, like 21:9 or 47:20 - and the new presets show up on the next node you add. The list is loaded at node creation, so an edit won't appear on an already-open node.
Installing it
ComfyUI Manager, search "yaResolution Selector", install, restart. Or the manual way:
cd ComfyUI/custom_nodes
git clone https://github.com/Tropfchen/ComfyUI-yaResolutionSelector
Then restart ComfyUI. That's the whole install - there's no requirements.txt to resolve and no model file to download, which is genuinely refreshing in a space where half the packs you install want a GB of weights.
Where people get burned
- "It's outputting tiny images." Overextend defaults to off, so 16:9 on a 512 base is a small 512x288. That's the feature doing its job - generate near native, then upscale. Flip overextend if you want the big side.
- "I edited ratios.txt and nothing changed." It's read at node creation. Add a fresh node or restart.
- Kept the format right? A preset line without a
digits:digitspair makes the node throw instead of guessing.
The wider point is the workflow the README pushes: generate at a sane native size and then hook the selector into an upscale chain for a big 16:10 or 21:9 wallpaper. ComfyUI's own guidance agrees - generating at 1920x1080 directly invites tiling and duplicated anatomy; generate near native and let an upscaler earn its keep. YARS just makes sure the numbers feeding that chain are right every time.
It won't fix your composition. It just stops you from typing 1216x832 from memory, getting 812x613, and wondering why the horse has two heads.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| base_resolution | INT | 512512–8192 | — |
| aspect_ratio | COMBO | 13 options: 1:1, landscape (5:4), landscape (4:3), landscape (3:2), landscape (16:10), landscape (16:9), +7 | |
| overextend | BOOLEAN | false | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| width | INT | — |
| height | INT | — |