When generating images with Stable Diffusion the width and height are important parameters that affect your final result.
Width and height determine the size and aspect ratio of your generated image. Stable Diffusion models have an optimal range of sizes they work best with:
- Stable Diffusion 1.5: 512×512 pixels (1:1 aspect ratio)
- Stable Diffusion 2.1: 768×768 pixels (1:1)
- Stable Diffusion XL: 1024×1024 pixels (1:1)
You can generate other aspect ratios, but stick close to the model’s native resolution for best results:
Width x Height | Aspect Ratio | SD 1.5 | SD 2.1 | SD XL |
---|---|---|---|---|
512 x 512 | 1:1 (square) | ✓ | – | – |
768 x 512 | 3:2 | ✓ | – | – |
512 x 768 | 2:3 | ✓ | – | – |
768 x 576 | 4:3 | ✓ | – | – |
896 x 512 | 16:9 | ✓ | – | – |
768 x 768 | 1:1 (square) | – | ✓ | – |
1152 x 768 | 3:2 | – | ✓ | – |
768 x 1152 | 2:3 | – | ✓ | – |
1024 x 768 | 4:3 | – | ✓ | – |
1152 x 648 | 16:9 | – | ✓ | – |
1024 x 1024 | 1:1 (square) | – | – | ✓ |
1152 x 896 | 9:7 | – | – | ✓ |
896 x 1152 | 7:9 | – | – | ✓ |
1216 x 832 | 19:13 | – | – | ✓ |
832 x 1216 | 13:19 | – | – | ✓ |
1344 x 768 | 7:4 | – | – | ✓ |
768 x 1344 | 4:7 | – | – | ✓ |
1536 x 640 | 12:5 | – | – | ✓ |
640 x 1536 | 5:12 | – | – | ✓ |
Different aspect ratios can greatly influence the final output of the image.
In general, you should never go lower than the minimum size image that the model was train on (i.e. no edge shorter than 512 pixels).