Aspect ratio
Recommended size
- Megapixels
- —
- Actual ratio
- —
- Simplified
- —
- vs native area
- —
Sized to keep the model's native pixel count, with each side a multiple of the step — the resolutions SDXL was trained on.
A resolution calculator that instantly gives you the right width × height for a target aspect ratio in Stable Diffusion / SDXL. Pick a base model (SDXL, SD 1.5, FLUX) and a ratio, and it returns a recommended size that keeps the model's native total pixel count (about 1 megapixel for SDXL) while rounding each side to a multiple of 64. Because SDXL was trained on a set of resolutions clustered around 1024×1024, generating far from that native pixel count — or with sides that aren't divisible by 64 — tends to cause broken composition, duplicated subjects, and stretched, distorted figures. The tool also shows megapixels, the actual ratio, the simplified ratio, and the area relative to native, so you can see at a glance how far you are from the trained sweet spot. Beyond presets (1:1, 3:2, 16:9, 9:16, and more) you can type a ratio directly and swap width/height with one click. It's pure calculation with no external API or data, so nothing is ever sent anywhere — everything runs locally in your browser.
How to use
- Pick a base model (SDXL, SD 1.5, FLUX). The calculation matches each model's native total pixel count.
- Choose a target aspect ratio from the presets, or type a width:height ratio directly (use "Swap" to flip orientation).
- Copy the recommended "Width × Height" and paste it into the size fields of your generator (WebUI / ComfyUI, etc.).
FAQ
Is anything I enter sent to a server?
No. The resolution math runs entirely in your browser, with no external API or data. The model and ratio you pick are never uploaded, stored, or sent anywhere — they are processed only on your device.
Why round to a multiple of 64?
Stable Diffusion / SDXL works in a latent space downscaled 8× from the image, and the UNet downsamples several more times, so sides that aren't divisible by 8 or 64 get padded and produce messy edges. Keeping each side a multiple of 64 is the safe default. The tool lets you choose 64 or 8 as the rounding step.
What is SDXL's native resolution?
SDXL was trained on several aspect ratios centered on 1024×1024, at roughly one megapixel total. Drifting far from that native pixel count tends to cause broken composition, duplicated people or hands, and unnatural stretching. This tool keeps the total pixel count near native even as you change the ratio.
Does it work for SD 1.5 and FLUX too?
Yes. Switching the base model recalculates the recommended size against that model's native total pixel count (SD 1.5 is around 512×512 ≈ 0.26 MP, while SDXL/FLUX are around 1 MP).
Can I enter a custom aspect ratio?
Yes. Alongside the presets (1:1, 3:2, 2:3, 16:9, 9:16, and more) you can type the width and height ratio as numbers. Results update in real time, and the "Swap" button flips orientation.
What if I want a larger image than this gives me?
The usual approach is to generate at this near-native resolution first, then enlarge with an upscaler (hires.fix or a separate upscaler). Generating far above native from the start tends to break the image.