Models / Stability AI
Image

SD XL

Stable Diffusion XL base model

About model

On Together AI, SD XL costs $0.0019 per image.

SD XL is Stability AI's Stable Diffusion XL 1.0 base model, an open latent diffusion model for text-to-image generation released in July 2023. It generates images at a native resolution of 1024x1024 and uses a UNet backbone three times larger than earlier Stable Diffusion versions, with two text encoders, OpenCLIP-ViT/G and CLIP-ViT/L. Stability AI trained it on multiple aspect ratios and reports that it creates detailed images from a few words, without quality keywords such as "masterpiece". The base model has 3.5 billion parameters and works on its own, without the separate refiner model that Stability AI also published. Available on Together AI.

Misty mountain ridges at sunrise fading into the distance
Landscapes
Layers of misty ridges at sunrise.
Prompt
Photograph of misty mountain ridges at sunrise, layers of blue hills fading into the distance, golden light on the highest peaks.
An oil painting of a sailboat on a rough sea under a cloudy sky
Painting styles
A sailboat in rough sea, in thick oil brushstrokes.
Prompt
An oil painting of a sailboat on a rough sea under a dramatic cloudy sky, thick visible brushstrokes, rich blues and warm highlights.
A macro photograph of a red ladybird on a green leaf with dew drops
Macro
A ladybird on a leaf covered in dew.
Prompt
Macro photograph of a red ladybird on a green leaf with dew drops, soft blurred background.
Generated with SD XL on Together AI. Images are unedited.
Parameters

3.5B

Size of the base model, as reported by Stability AI

Native Resolution

1024px

1024x1024 base resolution, trained on multiple aspect ratios

Text Encoders

2

OpenCLIP-ViT/G and CLIP-ViT/L

Model key capabilities
  • Native 1024x1024 Output: Generates at 1024x1024 with better contrast, lighting and shadows than its predecessor, per Stability AI
  • Short Prompts: Stability AI reports detailed images from a few words, with no need for quality keywords
  • Wide Style Range: Photorealism and a broad range of art styles from the same model
  • Production-Ready Infrastructure: 99.9% SLA, available on Together AI serverless infrastructure
Quickstart guides
  • API usage

    • cURL
    • Python
    • Typescript

    Endpoint:

    stabilityai/stable-diffusion-xl-base-1.0

    curl -X POST "https://api.together.ai/v1/images/generations" \
      -H "Authorization: Bearer $TOGETHER_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "stabilityai/stable-diffusion-xl-base-1.0",
        "prompt": "A serene mountain landscape at sunset with a lake reflection"
      }'
    from together import Together
    
    client = Together()
    
    response = client.images.generate(
        model="stabilityai/stable-diffusion-xl-base-1.0",
        prompt="A serene mountain landscape at sunset with a lake reflection",
    )
    
    print(response.data[0].url)
    import Together from 'together-ai';
    
    const together = new Together();
    
    const response = await together.images.generate({
      model: "stabilityai/stable-diffusion-xl-base-1.0",
      prompt: "A serene mountain landscape at sunset with a lake reflection",
    });
    
    console.log(response.data[0].url);
  • Model card

    Architecture Overview:
    • Latent diffusion model with a UNet backbone three times larger than previous Stable Diffusion versions
    • Two fixed, pretrained text encoders: OpenCLIP-ViT/G and CLIP-ViT/L
    • 3.5 billion parameter base model that can be used as a standalone module
    • Native 1024x1024 resolution

    Training Methodology:
    • Trained on multiple aspect ratios with new conditioning schemes described in the SDXL paper
    • Released by Stability AI with code and weights under the CreativeML Open RAIL++-M license

    Performance Characteristics:
    • The model card reports that users preferred the SDXL base model over Stable Diffusion 1.5 and 2.1 by a significant margin
    • Stability AI describes vibrant and accurate colors with better contrast, lighting and shadows than its predecessor

  • Prompting

    Together AI API Access:
    • Access SD XL via Together AI APIs using the endpoint stabilityai/stable-diffusion-xl-base-1.0
    • Authenticate using your Together AI API key in request headers
    • Send an image generation request with a text prompt
    • Set width and height in the request. 1024x1024 is the model's native resolution
    • Short prompts work. Stability AI notes that the model needs only a few words and no qualifier terms
    • Available on Together AI serverless infrastructure

  • Applications & use cases

    General Image Generation:
    • Create illustrations, concept art and photorealistic images from text
    • Generate the same idea in several art styles
    • Produce square and non-square images from one model

    High-Volume and Low-Cost Workloads:
    • Batch-generate images for catalogs, thumbnails and placeholders
    • Run large prompt sweeps where cost per image matters

    Product Features:
    • Add text-to-image to an app with an open model that has published code and weights
    • Offer a fast, low-cost tier next to newer image models