Boost Rendering Speed with Stable Diffusion's Simple Trick

Updated
 Boost Rendering Speed with Stable Diffusion's Simple Trick
Learn how to speed up your renders by up to 50% using a quick and easy fix. Discover how a specific configuration can optimize your stable diffusion process and increase rendering efficiency on Nvidia cards. Read on to find out how to implement this three-second solution and maximize your rendering speed.

1. Introduction

Is your Stable Diffusion running slow? In this blog post, I will walk you through some simple tricks that can significantly increase the speed of your renders. By making a specific configuration change and applying some tricks you can optimize the stable diffusion process and achieve faster rendering times on your Nvidia graphics card.

2. Enhancing Render Speed in Stable Diffusion

The first step in enhancing the rendering speed is to edit your "webui-user.bat" file. This file is located in the root stable diffusion directory: boost-rendering-speed-with-stable-diffusion's-simple-trick_1.png

To edit settings, right-click on the file webui-user.bat and select Edit. (You may need to select “Show More Options” first if you use Windows 11). Now edit the file by:

  • Adding --xformers to the COMMANDLINE_ARGS like so: set COMMANDLINE_ARG = --xformers

The edited file should be looking something like this: boost-rendering-speed-with-stable-diffusion's-simple-trick.png

  • Save the file and close it.

Now double click on the "webui-user.bat" file to restart Stable Diffusion. If this is your first time applying the fix, you will see a message indicating that xformers is being installed. Once the installation is complete, the message "launching web UI with arguments xformers" will appear, indicating that the optimization has been successfully applied.

Once you have successfully applied these settings, you will notice a significant increase in rendering speed when generating images. However, that's not all! There are still several other tips to further enhance the rendering speed in stable diffusion. Keep reading to discover more.

Stable Diffusion in the Cloud⚡️Run Automatic1111 in your browser in under 90 seconds
20% bonus on first deposit

3. TIP 1: Increasing Batch Size

By increasing the Batch Size (to around 4), you can achieve a noticeable speed boost. Utilizing a batch size of 4-6 will result in VRAM dumping between each image generation, thereby enhancing the rendering speed. boost-rendering-speed-with-stable-diffusion's-simple-trick_3_nextdiffusion.png

However, it's important to note that for larger batch sizes, the performance benefit tends to plateau.

4. TIP 2: Disable Live Preview Mode

Another valuable tip to enhance rendering speed is to disable the "Live Preview Mode" when generating images. You could additionally set the "Live preview display period" to -1. This will make sure that the images are only shown after completion of the batch. To change these settings do the following:

  • Go to the "Settings" tab
  • Click "Live Previews" in the left sidebar
  • Make sure to untick the box "Show live previews of the created image" to disable live previews
  • Slide the "Live preview display period" all the way to the left (value -1) to only show the completed batch of images.

The settings should be looking like this: boost-rendering-speed-with-stable-diffusion's-simple-trick_2.png

Stable Diffusion in the Cloud⚡️Run Automatic1111 in your browser in under 90 seconds

4. Examples (Boost Rendering Speed)

Did you know that when using these rendering speed tips, the images of sports cars are generated so quickly that it's almost like they're breaking the sound barrier? Buckle up and prepare for some turbocharged renderings!

Example 1: boost-rendering-speed-with-stable-diffusion's-simple-trick_nextdiffusion_1.png

Example 2: boost-rendering-speed-with-stable-diffusion's-simple-trick_nextdiffusion_2.png

Exmaple 3: boost-rendering-speed-with-stable-diffusion's-simple-trick_nextdiffusion_3.png

5. Alternatives to Speed up Image Generation (LCM LoRA's)

Recently LCM LoRA Model hit the Stable Diffusion community. Fueled by the quest for swifter and more efficient image generation, LCMs bring about a revolution, allowing rapid, high-fidelity sampling with minimal steps on pre-trained LDMs. Dive in with us as we turbocharge your stable diffusion image creation for unparalleled speed and quality.

How to Speed Up Image Generation with LCM LoRA's (A1111)

Stable Diffusion in the Cloud⚡️Run Automatic1111 in your browser in under 90 seconds

6. Conclusion

By implementing these simple fixes and tips, you can significantly accelerate your stable diffusion renders. The render speed improvement depends on your Nvidia graphics card, but regardless, activating the optimization is worth it. We encourage you to apply these tricks and settings and hope that you will have amazing results. Thanks for tuning in and happy rendering!

Frequently Asked Questions

You should add the parameter "--xformers" to the "COMMANDLINE_ARGS" in the "webui-user.bat" file. This can be done by editing the file and appending the parameter to the existing settings.

Increasing the Batch Size to around 4 can result in a noticeable speed boost. Using a batch size of 4 will facilitate VRAM dumping between image generations, improving rendering speed. However, larger batch sizes might not provide as much of a performance benefit.