|

SDXL Turbo Guide: Real-Time Prompting In Stable Diffusion

Stability AI released a new iteration of their SDXL model which significantly improved upon the previous model in terms of speed and performance. 

The new model called SDXL Turbo is the next step in image generation using Stable Diffusion as it allows real-time image generation. 

This is a huge deal for anyone who is familiar with Stable Diffusion and wants to generate images quickly. 

In this SDXL Turbo guide, I’ll walk you through this new model, how to use it, and the best settings to generate perfect images. 

Without any further ado, let’s dive in. 

Key Takeaways

Here are some key takeaways from SDXL Turbo: 

  • SDXL Turbo is trained on 512×512 images and generates images in real time with a single sampling step. 
  • It’s released for free under a non-commercial license allowing you to use it for personal use. 
  • It works on both Automatic1111 and ComfyUI. 
  • SDXL Turbo supports ControlNet and SDXL LoRA models. 
  • SDXL Turbo can run fast even on devices with lower-end GPUs. 
  • The model cannot generate legible text and doesn’t achieve photorealism perfectly. 
  • Faces aren’t generated perfectly in SDXL Turbo. 

What is SDXL Turbo? 

SDXL Turbo is a new model for Stable Diffusion released by Stability AI on 28 November 2023. This model enables single-step image generation which allows you to generate images in real time. 

SDXL Turbo is based on a novel distillation technique called Adversarial Diffusion Distillation (ADD) which brings many advantages to image generation. 

For starters, the new ADD technique allows you to generate images with just one sampling step instead of 30 or 50. Moreover, the single-step generation outputs a high-quality image without any blurriness or artifacts. 

Since SDXL Turbo allows single-step image generation, this means you can generate text-to-image outputs in real-time. 

The SDXL Turbo model is based on their previous SDXL model but is trained on 512×512 images. 

SDXL Turbo is currently released under a non-commercial license allowing you to use it for free for personal uses only. 

Related: Stable Diffusion vs Dall-E: Which One Is Better?

How To Use SDXL Turbo 

If you want to use SDXL Turbo, you can do it easily locally on your device or try its demo on ClipDrop.

I’ve tried it locally on my device and was amazed by how good and fast it was. Let’s take a look at how you can use SDXL Turbo locally on your device. 

SDXL Turbo Requirements

Stability AI hasn’t released any specific hardware or software requirements for running the SDXL Turbo model. 

However, it’s important to note that this model is trained on 512×512 images and requires a single step, so it will run on lower-end devices as well. 

Based on the requirements for the Stable Diffusion 1.5 and SDXL, here are the requirements to run SDXL Turbo: 

  • GPU with 4GB VRAM 
  • 8GB RAM 
  • Any modern Intel or AMD CPU 
  • 10-15GB Storage 

The requirements for running SDXL Turbo aren’t that high and even with low-end configurations, you’ll be able to generate images in real-time. 

For reference, I’m able to generate images in real-time using SDXL Turbo on my Lenovo Legion 5 laptop that has an Nvidia RTX 3050 GPU with 4GB VRAM. 

Install SDXL Turbo On Automatic1111

Running SDXL Turbo on Automatic1111 is pretty similar to using any other checkpoint model on Automatic1111. 

You can check out my Automatic1111 guide if you’re not familiar with it and want to get started. 

Here are the steps to install SDXL Turbo on Automatic1111: 

Step 1. Download the SDXL Turbo Model 

You can download the SDXL Turbo model from here

Once the model is downloaded, place it in the stable-diffusion-webui > Models > Stable Diffusion directory where all the other checkpoint models are stored. 

Step 2. Select the SDXL Turbo Checkpoint in Automatic1111

In Automatic1111, select the SDXL Turbo model from the checkpoints dropdown at the top. Enter your prompt in the txt2img section of Automatic1111. 

SDXL Turbo - Automatic1111 Select Checkpoint

Here’s the prompt I’m using for this guide: 

A beautiful butterfly inside a glass jar surrounded by fireflies, dark forest, winter, snow, cinematic composition 

Here are the generation settings:

  • Sampling Steps: 1
  • CFG Scale: 1
  • Size: 512×512
  • Sampler: Euler A 

Step 3. Generate Your Image

Click on the Generate button to generate your images. You’ll notice that image generation is extremely fast compared to other Stable Diffusion models. 

SDXL Turbo - Output Image

Install SDXL Turbo On ComfyUI

Using SDXL Turbo on ComfyUI is very easy since there’s official support for it. You can check out my ComfyUI guide if you’re not familiar with it. 

Here are the steps to install SDXL Turbo on ComfyUI: 

Step 1. Update ComfyUI to the Latest Version 

First, you need to update ComfyUI to the latest version in order to run SDXL Turbo. 

Update ComfyUI

In your ComfyUI directory, go to the Update folder and click on the update_comfyui.bat file. This will update ComfyUI to the latest version. 

Step 2. Download the SDXL Turbo Model 

You can download the SDXL Turbo model from here

Once the model is downloaded, place it in the ComfyUI > Models > Checkpoints directory where all the other checkpoint models are stored. 

Step 3. Load SDXL Turbo Workflow

In order to use SDXL Turbo, you’ll have to use its ComfyUI workflow. Download the image given below and drag and drop it to your ComfyUI to load the workflow.

Alternatively, you can also find the SDXL workflow for ComfyUI here.

SDXL Turbo Example

Step 4. Enable Real-Time Prompting

To enable real-time prompting in ComfyUI, click on the Extra Options checkbox and then enable the Auto Queue checkbox. 

ComfyUI - Enable Auto Queue

This enables real-time prompting in ComfyUI allowing you to SDXL Turbo as intended. 

Step 5. Enter Your Prompt & Generate Image

Now, all you have to do is enter your prompts and generate your image. I’ve used the following prompt for this guide: 

A beautiful butterfly inside a glass jar surrounded by fireflies, dark forest, winter, snow, cinematic composition 

Once you’ve generated your image for the first time, you can now go ahead and customize the prompt and it’ll change the output in real time. 

This is how real-time prompting works in ComfyUI using the SDXL Turbo model. 

Best Settings for SDXL Turbo 

Since SDXL Turbo is very different from the other Stable Diffusion models, it’s important to note that you can’t deviate too much from the intended workflow settings. 

SDXL Turbo is a single-step generation model and too drastic changes in the sampling steps or CFG scale could result in bad outputs. 

Here are some experiments I’ve conducted to determine the best settings for SDXL Turbo. 

Sampling Steps

SDXL Turbo is trained to generate images in 1 step which is why you shouldn’t change it. 

If you go higher and set sampling steps to 3,5, or 10, the image quality degrades significantly introducing artifacts and blurriness. 

SDXL Turbo - Sampling Steps Comparison

You should set the sampling steps between 1-4 and shouldn’t go beyond 4. 

CFG Scale

Just like the sampling steps, you cannot change the CFG scale too much with the SDXL Turbo model. 

The reason is that if you go higher than 1 CFG scale, the images will get oversaturated and too bright. 

SDXL Turbo - CFG Scale Comparison

Moreover, going too high above 1 for the CFG Scale won’t change the image output by much. You can set the CFG scale between 0.6 to 1.4. 

Sampler

Euler samplers seem to work the best with SDXL Turbo. Many samplers aren’t supported or don’t even work with SDXL Turbo. 

Your best bet is to stick with Euler Ancestral as it’s the most reliable. DPM++ 2S a Karras also produces decent outputs but it can be a hit or miss. 

Image Size

SDXL Turbo is trained on 512×512 images so that’s the best image size you can choose. But you can still generate decent high-quality outputs at 768×768. 

SDXL Turbo - Image Size Comparison

However, if you go beyond that size, the quality will degrade and you won’t get good images at all. 

If you wish to generate really high-resolution images using SDXL Turbo, you can simply generate them at 512×512 and then use hi-res fix and upscale them. 

Negative Prompt

In my tests, I noticed that the negative prompt has no effect to the output image no matter what sampling step or CFG scale you choose.

When using SDXL Turbo, don’t bother writing a negative prompt as there’s no change or very minimal change.

FAQs

Here are some frequently asked questions about SDXL Turbo: 

Does SDXL Turbo Work With ControlNet? 

Yes, SDXL Turbo currently seems to work with ContolNet but it’s a bit wonky. You’ll have to properly configure and test different settings to get the best results. 

Is SDXL Turbo Better Than SDXL? 

SDXL Turbo is very different than SDXL in the sense that it’s a real-time image generation model that can be useful for quick brainstorming and trying out ideas whereas the SDXL model shines when it comes to generating extremely detailed and high-quality images. 

Is SDXL Turbo Free? 

Yes, SDXL Turbo is currently released for free under a non-commercial license allowing you to use it for personal projects for free. 

Does SDXL Turbo Support LoRA Models?

Yes, SDXL Turbo works with SDXL LoRA models perfectly. However, it doesn’t support SD 1.5 LoRA models.

Conclusion 

In less than a year, Stable Diffusion models have come a long way. SDXL Turbo comes just three months after the release of SDXL and it’s mind-blowing to see the progress being made. 

If you’re someone who wants to generate images quickly for ideation or brainstorming, SDXL Turbo can be your best friend. Real-time image generation is so good that it can help you in many different ways. 

If you have any questions about SDXL Turbo, feel free to drop them in the comments below.

Stable Diffusion Prompt Organizer

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.