One of the most persistent failure modes in generative image synthesis — duplicate torsos, double heads, and elongated limbs — stems directly from generating images at aspect ratios mismatched with model latent training buckets.

1. Why Arbitrary Dimensions Cause Duplication

Early diffusion models (like SD 1.5) were trained exclusively on square $512 \times 512$ pixel images. When asked to render a $512 \times 1024$ vertical image, the spatial attention receptive field could not span the entire vertical latent dimension.

As a result, the model treated the top half of the latent canvas and the bottom half as two semi-independent images, rendering one full person in the upper half and a second torso in the lower half.

2. Modern Multi-Aspect Training Buckets

Modern architectures (such as SDXL and Flux) resolve this via multi-aspect bucket training. During training, datasets are categorized into predefined aspect ratio "buckets" where total pixel count remains approximately constant (~$1.04$ megapixels for SDXL, ~$1.0$ megapixel for Flux).

Generating precisely within these trained bucket dimensions guarantees that the self-attention receptive field encompasses the entire spatial image plane.

Ratio Exact Resolution Total Pixels Megapixels
1:11024 × 10241,048,5761.05 MP
16:91344 × 7681,032,1921.03 MP
9:16768 × 13441,032,1921.03 MP
4:31152 × 864995,3281.00 MP
3:4864 × 1152995,3281.00 MP
3:21216 × 8321,011,7121.01 MP
2:3832 × 12161,011,7121.01 MP
21:91536 × 640983,0400.98 MP

3. The 64-Pixel VAE Divisibility Rule

The Variational Autoencoder (VAE) compresses pixel inputs by factor 8 in both spatial dimensions ($H/8, W/8$). Within the UNet or DiT backbone, features undergo downsampling by up to factor 8 again.

Therefore, the minimum spatial dimension step size is $8 \times 8 = 64$ pixels. If an image is rendered at $1000 \times 1000$ pixels:

$$1000 \div 64 = 15.625 \quad (\text{Non-integer fraction})$$

The latent tensor cannot be processed cleanly without internal padding and cropping, creating boundary noise and blurry seam artifacts upon VAE decoding.

Calculate Instantly: Use our free Aspect Ratio & Bucket Calculator to calculate exact VAE-compliant dimensions for any custom ratio.