🔁SDXL update guide

Details how to change your settings and code from the beta version to the new one

The beta version of SDXL training is deprecated and will reach End Of Life on April 9th 2024. Read ahead to learn how to update.

SDXL training via API

Until February 16th 2024, SDXL training was in beta. Until then, the UNet and both Text Encoders were trained at resolution 512x512. On February 17th we announced a new improved version of SDXL training at 1024x1024.

For backwards compatibility, we are still allowing using the beta version of SDXL training until April 9th 2024.

The beta training mode is enabled whenever the block text_encoder_training is present. As a result, this field is now deprecated and should not be used anymore (don't include it, or set it to null) if you want to use the latest version of SDXL training.

Beta SDXL training (deprecated)

The text_encoder_training block is set (deprecated). This will result in 512x512 beta training:

curl 'https://api.dreamlook.ai/dreambooth' \
    -H "content-type: application/json" \
    -H "authorization: Bearer $DREAMLOOK_API_KEY" \
    --data-raw '{
        "image_urls": [...],
        "instance_prompt": "photo of ukj person",
        "steps": 1500,
        "model_type": "sdxl-v1",
        "base_model": "stable-diffusion-xl-v1-0",
        "learning_rate": 1e-5,
        "text_encoder_training": {
            "steps": 100,
            "learning_rate": 0.00001
        }
    }'

New SDXL training

The text_encoder_training block is not set, instead learning_rate_te1 and learning_rate_te2 are used to set Text Encoders learning rates. This will result in the new 1024x1024 training.

curl 'https://api.dreamlook.ai/dreambooth' \
    -H "content-type: application/json" \
    -H "authorization: Bearer $DREAMLOOK_API_KEY" \
    --data-raw '{
        "image_urls": [...],
        "instance_prompt": "photo of ukj person",
        "steps": 1500,
        "model_type": "sdxl-v1",
        "base_model": "stable-diffusion-xl-v1-0",
        "learning_rate": 1e-5,
        "learning_rate_te1": 3e-6,
        "learning_rate_te2": 0
    }'

New SDXL training parameters

With this change, we recommend a new set of parameters depending on the type of subject you are training on.

For the beta version, our recommendation was the following:

  • Train on 7 to 12 high-quality images

  • 2400 training steps

  • Enable Text Encoder training

  • Learning rate of 1e-5 for the UNet and both Text Encoders

For the new version, see our recommendations on this page for optimal portrait and style training parameters: Stable Diffusion XL

Generally, the new version requires fewer images. For portrait, we recommend using 1500 steps instead of 2400 steps.

SDXL generation via API

The new version of SDXL introduces a new sampler: dpmpp-2m-karras, which is the new default for SDXL.

We are deprecating:

  • The dpm++ scheduler (dpmpp-2m) for SDXL

  • The beta Euler scheduler (euler-sdxl-beta) for SDXL

Theses schedulers will reach End Of Life on April 9th 2024.

Last updated