* This blog post is a summary of this video.

8 Tips to Speed Up SDXL Generations for Automatic1111

Author: Incite AITime: 2024-03-23 10:00:00

Table of Contents

Free Up RAM and VRAM for Faster SDXL Generations

Running automatic1111's SDXL is very demanding on system resources like RAM and VRAM. If your system peaks in usage during image generation, it can dramatically slow things down or even halt the process entirely. So one of the best things you can do is close any unnecessary applications to free up as much memory as possible. This includes closing unused browser tabs, which are notorious for hogging RAM.

It's helpful to have Windows Task Manager open while running SDXL generations. This allows you to monitor system resource usage and identify potential bottlenecks. Pay special attention to RAM and VRAM usage. If either is maxing out, you'll need to free up additional capacity to prevent slow downs.

Force Quit Unneeded Background Apps

Be aggressive in quitting any non-essential apps running in the background on your system. On Windows, check the Task Manager's Processes tab to view everything currently open. Mac users can use the Force Quit window to see open apps. Quit anything not needed for SDXL image generation. Web browsers like Chrome and Firefox tend to use lots of RAM. So make sure to close all open browser windows and tabs during long SDXL generations. You can reopen them when the generation is complete without losing state thanks to session restoring.

Enable Medium VRAM Mode for Cards Under 8GB

For GPUs with less than 8GB of VRAM, it's highly recommended to enable the medium VRAM mode in automatic1111's launch settings. This reduces VRAM usage to prevent out of memory issues during generation.

To enable medium VRAM mode, head over to your automatic1111 folder and open the stable-diffusion-webui subfolder. Right click the Windows batch file named web-ui-user.cmd and choose Edit. Then add the command line argument --medvram after 'set command_line_args='. Save the file and restart the web UI for the changes to apply.

Use Xformers Optimization for Nvidia GPUs

If running on an Nvidia GPU, you can enable the xformers optimization for faster performance. Xformers is a Python package that helps speed up Tensor operations on Nvidia hardware. To add it, go to the automatic1111/stable-diffusion-webui/modules folder and edit paths_config.py.

In paths_config.py, find the section with command_line_args and add --xformers between the quotation marks. Save the file and restart automatic1111. You may see improved generation speeds, especially on higher end Nvidia cards.

Disable Chrome Hardware Acceleration

You might be surprised to learn that Chrome isn't just a RAM hog - it can also consume your precious graphics card VRAM. To prevent this, head to Chrome's settings and disable 'Use hardware acceleration when available' under Advanced settings.

Hardware acceleration isn't needed for typical web browsing. And preventing Chrome from tapping your GPU's VRAM can make more available for SDXL image generations. Just remember to re-enable hardware acceleration afterwards for full Chrome performance.

Use Correct Python 3.10.6 Version

Automatic1111 is designed to run on a specific Python version - 3.10.6. Using any other version can lead to issues. To check which Python version you currently have installed, open Command Prompt and type 'python --version'. If it's not 3.10.6, you'll want to remove the existing Python install.

The easiest way to uninstall Python is through the Add/Remove Programs control panel on Windows. Then install the correct 3.10.6 version using the link in the video description below. With the right Python release, you may see performance and stability improvements in automatic1111.

Disable Extensions Causing Slowdowns

Some browser extensions conflict with automatic1111 and SDXL, leading to slow performance. An easy way to test is disabling all extensions temporarily and running a generation.

In automatic1111, go to the Extensions tab and choose 'Disable All Extensions'. Then click Apply and restart the UI. If generation speeds increase significantly, turn extensions back on one-by-one until you identify any problem addons. These should be removed or settings adjusted to play nicely with SDXL.

Install MioAI Assistant for Optimization

Even though I suggested disabling extensions, there's one called MioAI Assistant that can actually help optimize automatic1111 performance. It has handy tools like showing your system stats including available VRAM.

If you notice VRAM not being properly released during generations, MioAI Assistant has a 'Force VRAM release' button to manually clear it up. The extension can also easily apply optimal launch arguments and VRAM configuration based on your GPU. Definitely worth checking out!

Update to the Latest automatic1111 Release

Updating to the newest automatic1111 version can improve SDXL performance and stability in some cases. However upgrades often introduce new bugs initially until they are ironed out.

So updating is a bit of a calculated risk. If you decide to try upgrading, go to the stable-diffusion-webui folder in automatic1111 and type 'git pull' in command prompt to fetch the latest code from GitHub.


Q: Why are my SDXL generations slow?
A: SDXL generations can be slow due to limited RAM, VRAM, incorrect software configurations, and extensions conflicts.

Q: How can I speed up SDXL on Automatic1111?
A: Tips to speed up SDXL include freeing up system resources, enabling Med VRAM mode, using Xformers, updating Python, disabling extensions, installing helpful extensions, and updating Automatic1111.

Q: What is the ideal RAM and VRAM for fast SDXL?
A: For fast SDXL generations, 16GB+ RAM and 8GB+ VRAM is recommended depending on your usage.

Q: Should I update Automatic1111 for better SDXL performance?
A: Updating Automatic1111 can sometimes improve SDXL performance by including the latest optimizations, but updates can also initially cause breaking changes.

Q: Can using Google Colab help with slow SDXL generations?
A: Yes, Google Colab offloads the resource-intensive SDXL process to the cloud, helping improve performance significantly.

Q: Which Python version should I use for Automatic1111?
A: Automatic1111 is designed to work best with Python 3.10.6. Using other versions can cause issues.

Q: How do I enable Med VRAM mode?
A: Med VRAM mode reduces VRAM usage and can be enabled by adding --medvram to the Automatic1111 launch options.

Q: What does the Xformers extension do?
A: Xformers helps optimize and accelerate SDXL generation times when using Nvidia GPUs.

Q: Why disable Chrome hardware acceleration?
A: Disabling hardware acceleration prevents Chrome from competing for scarce VRAM resources needed for fast SDXL generations.

Q: Can extensions cause slow SDXL generation times?
A: Yes, some extensions can conflict and cause slower SDXL. Temporarily disabling all extensions can help troubleshoot.