How It Works

Width & Height

Here are some different aspect ratios to keep in mind

Shawn @ Prompting Pixels

What You'll Learn

Learn the optimal width, height, and aspect ratio settings for AI image models including Stable Diffusion, SDXL, and Flux Dev. Includes comprehensive dimension tables and best practices.

Video Walkthrough

Prefer watching to reading? Follow along with a step-by-step video guide.

Width & Height

AI Image Generation: Width and Height Guide

When generating images with AI models like Stable Diffusion, Flux, and other image generation models, the width and height parameters are crucial settings that significantly affect your final result.

Width and height determine both the size and aspect ratio of your generated image. Each AI model has an optimal range of dimensions where it performs best, based on the resolution it was trained on.

Quick Reference Tool

For pixel-perfect dimensions optimized for any AI model, use our AI Image Aspect Ratio Calculator. It provides one-click copying of dimensions in multiple formats with real-time megapixel calculation and constraint validation.


Optimal Dimensions by Model

Stable Diffusion Models

ModelResolutionNotes
Stable Diffusion 1.5512×512 pixels (1:1)Trained on 512px resolution
Stable Diffusion 2.1768×768 pixels (1:1)Trained on 768px resolution
Stable Diffusion XL (SDXL)1024×1024 pixels (1:1)Trained on 1024px with 15+ supported aspect ratios
SDXL Turbo512×512 pixelsOptimized for speed at lower resolution
SDXL Lightning1024×1024 pixelsSame as SDXL base
Pony Diffusion1024×1024 pixelsSDXL-based

Modern AI Image Models

ModelResolutionNotes
Flux Dev1024×1024 or 1MP equivalentsFlexible megapixel targeting with 32px increment constraints
Flux SchnellSame as Flux DevOptimized for speed
Hunyuan DiT1024×1024 pixelsRecommended
Qwen VL (Image)1024×1024 or higherFlexible dimensions
Kolors1024×1024 pixelsSimilar to SDXL

SDXL Supported Aspect Ratios

SDXL natively supports these resolutions for optimal quality:

Width × HeightAspect RatioUse Case
1024 × 10241:1 (square)Social media, icons
1152 × 8969:7Portrait orientation
896 × 11527:9Portrait orientation
1216 × 83219:13Landscape photos
832 × 121613:19Portrait photos
1344 × 7687:4Wide landscape
768 × 13444:7Tall portrait
1536 × 64012:5Ultra-wide
640 × 15365:12Ultra-tall

Flux Dev Recommended Dimensions

Flux Dev works with dynamic megapixel targeting and requires dimensions in 32px increments:

Width × HeightAspect RatioMegapixels
1024 × 10241:1~1.0 MP
1344 × 76816:9~1.0 MP
768 × 13449:16~1.0 MP
1216 × 8323:2~1.0 MP
832 × 12162:3~1.0 MP
1536 × 10243:2~1.6 MP
1024 × 15362:3~1.6 MP

Legacy Models

For older Stable Diffusion models, here are the recommended dimensions:

Width × HeightAspect RatioSD 1.5SD 2.1
512 × 5121:1 (square)
768 × 5123:2
512 × 7682:3
768 × 5764:3
896 × 51216:9
768 × 7681:1 (square)
1152 × 7683:2
768 × 11522:3
1024 × 7684:3
1152 × 64816:9

Best Practices

  • Stay close to training resolution: Each model performs best at or near its native training resolution
  • Respect minimum dimensions: Never go below the minimum edge length the model was trained on (512px for SD 1.5, 768px for SD 2.1, 1024px for SDXL/Flux)
  • Use proper constraints: Many models require dimensions divisible by 8, 32, or 64 pixels
  • Consider megapixels: Higher megapixel values mean slower inference. Lower resolutions generate faster
  • Match aspect ratio to content: Use portrait ratios for people, landscape for scenery, square for social media
  • Use the calculator: Visit aspect.promptingpixels.com for pixel-perfect dimensions that avoid generation errors

Impact on Quality

Different aspect ratios and dimensions can significantly influence the final output quality:

  • Images generated at non-native resolutions may show artifacts or reduced quality
  • Extreme aspect ratios (like 16:9) work better with SDXL and Flux than older models
  • Upscaling from native resolution often produces better results than generating at high resolution directly
  • Composition and framing can be affected by aspect ratio choice

Video Generation Models

Note: Some AI models like Wan 2.2 are designed for video generation (text-to-video and image-to-video) rather than static image generation. These models have different resolution requirements.

ModelSupported ResolutionsDetails
Wan 2.2 T2V480P, 720PGenerates 5-second videos at 24fps using 1280×720 (720P) or 854×480 (480P)

Want More AI Image Tutorials?

Get the best AI image tutorials and tool reviews—no spam, just 1 or 2 helpful emails a month.

Continue Learning

More How It Works Tutorials

Explore additional tutorials in the How It Works category.

View All Tutorials