Skip to content

SDXL Aspect Ratio

SDXL NPU models support arbitrary aspect ratios at generation time, without requiring a separate model file per resolution.

How It Works

The SDXL UNet input is always fixed at 1024×1024 — the same single binary handles every aspect ratio. To produce a non-square image, the app uses an inpaint-style trick:

  1. The target output area is placed as a centered rectangle inside the 1024×1024 latent canvas.
  2. During every denoising step, the area outside that rectangle is masked off so the model only updates pixels inside the target region.
  3. After sampling finishes, the centered rectangle is cropped out and returned as the final image.

The result is that the model "thinks" it is generating a 1024×1024 image, but its denoising effort is constrained to the centered target rectangle — yielding a clean image at the requested aspect ratio.

Sizing Rule

  • The long side is always 1024.
  • The short side is computed proportionally from your selected aspect ratio, then rounded up to the nearest multiple of 8 — the model only accepts dimensions that are multiples of 8.

For example, a 3:2 selection computes 1024 × 2/3 ≈ 682.67 and rounds up to 1024×688; a 9:16 selection gives an exact 576×1024.

Performance

Because the underlying compute graph always runs at 1024×1024:

  • Generation time is identical regardless of the selected aspect ratio.
  • There is no smaller-resolution shortcut — selecting a tall or wide canvas does not speed things up, but it also does not slow them down.

Comparison with SD1.5

SD1.5 takes the opposite approach: each resolution (512×768, 768×512, 768×1024, 1024×768, …) is a separate patched model, and you must switch models to change canvas size. See SD1.5 NPU High Resolution.

SD1.5 NPUSDXL NPU
Per-resolution model filesYes (one per size)No (single 1024×1024 model)
Switching canvas sizeReloads a different patchInstant, no reload
Generation time vs. canvas sizeScales with resolutionConstant

Notes

  • The aspect-ratio selector only applies to SDXL NPU models. SD1.5 NPU continues to use per-resolution patches.
  • Extreme aspect ratios reduce the usable area inside the 1024×1024 canvas, which can affect composition quality at very thin or very wide ratios.