Best-Res (simple)
Type any resolution, get one that actually works
- width
- height
This is the quietest node in the Best Resolution pack, and honestly the one beginners should start with. Best-Res (simple) does one thing: it takes the width and height you want and rounds them to the nearest size that's actually legal for a diffusion model. That's it. No aspect-ratio magic, no megapixel targeting, no upscale planning. Just "make my numbers divisible by a step, without wrecking the ratio."
Why that matters
ComfyUI won't stop you from typing 1350x780 into an Empty Latent Image. It'll happily run - and produce a slightly wrong image, or a "not divisible by 8" complaint from your VAE, or a latent that refuses to round-trip cleanly. Every model family expects width and height to be multiples of its VAE's downscale factor: 8 for SD 1.5, SDXL and Flux. And if you plan to upscale later, keeping everything a multiple of a bigger step means the upscaled size stays clean too. This node is the "fix my lazy numbers" step that sits between you and the latent.
How it works
Internally it does the same 3-pass rounding as the whole pack: it rounds each side to the nearest multiple of step, then tries two more candidate pairs derived from the rounded sides, and keeps whichever one stays closest to your requested aspect ratio. So 1350x780 with step 48 lands on something like 1392x768 or 1344x768 - ratio preserved as closely as the step allows, both sides divisible by 48. The node also shows you the math on its face: the chosen width/height, how many steps each side is, and the real-vs-goal aspect ratio.
The inputs
width,height- approximate. They don't need to be clean; that's the point.step- the divisibility requirement. Default is 48 (see the tooltip: 8 × 2 × 3, so it survives a 1.5x or 1.333x latent upscale). Set it to 8 if you only generate at one size and never upscale. The README notes you can even setstepto 1 to effectively disable rounding if you're using the pack purely as a size calculator without any diffusion in the loop.
Outputs: width and height as INTs, ready for Empty Latent Image or a KSampler.
When to reach for it vs. the rest of the pack
The simple node is for when you already know roughly how big you want the image and just need it made legal. If you care about matching the model's training area (e.g. 1MP for SDXL at 16:9), Best-Res (area) does a better job - it keeps total pixels near native. If you're planning a hi-res fix, Best-Res (area+scale) is the one. This node is the boring, dependable option: no decisions, no surprises, two clean integers out.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/Lex-DRL/ComfyUI-BestResolution
or find "Best Resolution" in ComfyUI Manager, install, restart. Dependency is just frozendict, which Manager handles. No model downloads.
The honest take: if you're new and overwhelmed by resolution math, this node is a fine place to start, but you'll probably graduate to the area node within a week. The simple node fixes your numbers; the area node fixes your approach.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 10241–9223372036854776000 | Approximate width |
| height | INT | 10241–9223372036854776000 | Approximate height |
| step | INT | 481–9223372036854776000 | Both width and height will be divisible by this value - by rounding them to the closest appropriate resolution. The default 48 is (8 * 3 * 2), so it's a safe choice because: - it's compatible with SD1.5/XL downsampling factor (divisible by 8), - it can be upscaled by x1.5 or x1.333 at the first iteration, which is optimal for latent-upscale, - after x1.5 upscale, if you only do x2 later (it's OK for already high resolutions) - it will be divisible by 3 AND 9, which might become handy at that point, where you'll probably use UltimateSDUpscale. Other values worth trying first: 64, 96, 128. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| width | INT | — |
| height | INT | — |