santa hat
deerdeer nosedeer glow
Sign In

Aspect ratios and image sizes for Stable Diffusion - an overview

Aspect ratios and image sizes for Stable Diffusion - an overview

Because Stable Diffusion and Automatic 1111 only accept pixel numbers dividable by 8, it can be a little confusing to match the image size to certain aspect ratios. I collected info about the most common aspect ratios in use, and with Excel formulas was able to pinpoint a lot of matching sizes. which should work with SD 1.5 and A1111 (see table below). For SD XL, you may try to simply multiply the pixel numbers by 2. I haven't used XL much myself yet so not sure how well it would fit for this purpose - let me know in the comments if you think it would work, and I can make and upload an extra table with all image sizes doubled.
EDIT: The table is now improved and includes much larger image sizes, to support the newer SD versions which have become much more popular than when I first posted this table. You can see details about the changes in the update info at the bottom of this post.


https://i.imgur.com/jGyD4r6.png

(for PDF-version, see attachments to the right)

As for which aspect ratio to choose for an image with regard to composition and so on, that's another topic and a lot could be said about it (I'd suggest checking out some online photography guides). Some may decide based on how the image is going to be used. Or you may decide based on what kind of image you want to make (portrait, landscape). We typically use 1:1 or 2:3 a lot for Stable Diffusion on Civitai, but there are alternatives. For example, 4:3 or 3:4 is used in medium format photography, and 5:4 or 4:5 is common in large format photography (4:5 also happen to be common on Instagram...). So don't be afraid to try something new. And now you have a table for looking up a matching image size. :-)

Updated 8. june 2024 to version 2.
Changes:
- Fixed a bug (16:7 was not sorted to the correct row in the table).
- Added ratios: 1:4, 1:3, 8:15, 8:11, 7:9, 11:14, 7:8, 8:7, 14:11, 9:7, 11:8, 15:8, 3:1 and 4:1.
- Added info about art canvases in "Areas of use".

Updated 28. november 2024 to version 3:
Changes:
- Improved algoritm for sorting image sizes. Sizes with pixel numbers dividable by 512/256/128/64/32/16 are given priority in decreasing order.
- Allows for much larger image sizes to support newer SD versions. Sizes where the shortest edge is in the range 256 - 1536 now included. 
- Made the table slightly less wide, max 12 sizes per aspect ratio. This was possible due to the more efficient sorting algorithm.
- Added color marking for pixel numbers dividable by 512/256/128 in decreasing color strength.
- Added math formulas info for A-series paper size, golden ratio and silver ratio.

52

Comments