Width and height from aspect ratio 🪴
Pick a resolution without doing the math
- width
- height
You want a 16:9 image at roughly 1024 pixels, divisible by 8, and you do not want to open a calculator. That's the entire pitch. Pick a ratio from a dropdown, say how big, and this node hands you clean width and height numbers to drop into an Empty Latent. It's small, it's boring, and you'll use it constantly.
Why this matters more than it looks
Diffusion models have a native resolution they were trained at - SDXL and most Flux/Qwen-era models around 1024px, older SD 1.5 around 512px. Push far past that and you get the classic artifacts: duplicated subjects, tiling, and the extra-limbs problem the community complains about endlessly. And every dimension has to be divisible by 8, because the latent space the model works in is downsampled 8×; feed it a number that isn't and you get an error or a silent crop.
So "what resolution should I use?" is really two constraints at once - land near the model's sweet spot and stay divisible by 8, at the shape you want. Doing that by hand for 2:3 at 1024 is annoying. This node just does it.
The inputs
- aspect_ratio - a dropdown of the common ones:
1:1,2:3,3:2,3:4,4:3,4:5,16:9,9:16,9:21, and a few more. Portrait, landscape, square, cinema. - target_size - roughly how big the long side should be (default 1024). Think of it as "aim for this resolution."
- multiple_of (optional) - snaps both dimensions to a multiple of this. Default 8, which is what the VAE wants. Bump it to 16 or 64 if a particular model is picky.
Outputs are just width and height as integers. Wire them into an Empty Latent Image, or into any node that takes explicit dimensions.
How you'd actually use it
Drop it next to your Empty Latent, set 16:9 and 1024, connect the two outputs. Done. Change your mind about orientation later? Flip the dropdown to 9:16, no recalculating. It's the kind of node that removes a tiny recurring friction rather than doing anything flashy - which is exactly why it's worth having on the shelf.
The 🪴 in the name marks it as one of the familiar community utility nodes ComfyUI-Addoor bundles alongside its own - same idea you'll have seen in other resolution-picker packs.
Installing ComfyUI-Addoor
ComfyUI Manager: Install Custom Nodes → search "ComfyUI-Addoor" → install → restart. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/Eagle-CN/ComfyUI-Addoor.git
cd ComfyUI-Addoor
pip install -r requirements.txt
Restart and look under 🌻 Addoor / Utilities. One quick sanity check: match target_size to your model's native resolution - asking for 2048 out of an SDXL checkpoint just to get a bigger latent is how you summon the duplicated-subject gremlins. Generate near native, then upscale.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| aspect_ratio | COMBO | 1:1 | 13 options: 1:1, 1:2, 2:1, 2:3, 3:2, 3:4, +7 |
| target_size | INT | 102464–8192 | — |
| multiple_ofopt | INT | 81–1024 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| width | INT | — |
| height | INT | — |