How To Install Stable Diffusion XL 0.9 In Automatic1111 (Setup Guide)

Future Thinker @Benji
15 Jul 202304:23

TLDRStable Diffusion XL 0.9 is a new advancement in AI image generation, now officially supported in the Automatic1111 web UI. To install, you'll need Git and Python 3.10.6. Visit git.scm.com for Git and ensure Python is added to your environment variables. Clone the Automatic1111 repository and switch to the 'sdxl' development branch. Run the appropriate script for your OS to download and install necessary files. For Windows, use 'web user.bat', and for others, their respective scripts. Once completed, copy the 'stxl-0.9-safetose.txt' file into the 'model stable diffusion' folder within the web UI folder. You can obtain this file from the Hugging Face repository. After setup, run the web UI, select 'sdxl 0.9' from the checkpoints, and start generating images. If you encounter issues, modify the 'use IP.bat' script to include 'no half way' in the command line arguments. For better image quality, increase the resolution to 2048x2048. Note that while Stable Diffusion requires more VRAM (10-12 GB) than Comfy UI (8GB), optimization is ongoing. Also, Automatic1111 does not currently support Ensemble models, so the refiner model is not available. Regularly run 'git pull' to update to the latest features and fixes. Stay tuned for the official release of Stable Diffusion XL, which will explore support for low VRAM devices, AMD devices, and M1/M2 MacBooks.

Takeaways

  • 🚀 Stable Diffusion XL 0.9 is now supported in Automatic1111's web UI, offering advanced AI-generated images.
  • 💻 Prerequisites for installation include having Git and Python 3.10.6 installed on your system.
  • 📥 To install Git, visit git.scm.com and download the installer suitable for your operating system.
  • 🔍 Ensure you select the correct 32-bit or 64-bit installer for Windows users based on your CPU.
  • 📝 For Python installation, follow the link to the Python downloads page and add Python to your environment variables during setup.
  • 🔗 Clone the Automatic1111 repository by copying the HTTPS link and using the git clone command in your terminal.
  • 📂 Switch to the 'sdxl development' branch within the repository to prepare for Stable Diffusion.
  • 💾 Run the 'web user.bat' script for Windows or the appropriate script for other operating systems to install necessary files and packages.
  • 🌐 After setup, the web UI will be accessible at localhost:7860 for image generation.
  • 📄 Copy the 'stxl-0.9-safetostream.pt' file to the Stable Diffusion folder within the web UI folder from the Hugging Face repository.
  • 🔍 If you encounter issues with image generation, edit the 'use IP.bat' script to include the 'no-halfway' argument.
  • 📈 For better image quality, increase the resolution to 2024x2024 post-initial generation.
  • 💡 Keep in mind that Stable Diffusion requires more VRAM (around 10-12 GB) compared to other UIs like Comfy UI (8GB).
  • ⚙️ As the 'sdxl' branch is still under development, regularly run 'git pull' to get the latest updates and fixes.
  • ⛔ Automatic1111 currently does not support Ensemble models, meaning you can't use the refiner model as in Comfy UI.

Q & A

  • What is Stable Diffusion XL and how can it enhance AI-generated images?

    -Stable Diffusion XL is an advanced AI model designed to improve the quality of AI-generated images. It is officially supported in the Automatic1111 web UI and allows users to achieve higher quality results compared to previous versions, as seen in the impressive images posted by many users.

  • What are the prerequisites for installing Stable Diffusion XL in Automatic1111?

    -To install Stable Diffusion XL, you need to have Git and Python 3.10.6 installed on your system. Git can be downloaded from git.scm.com, and Python can be installed from the official Python downloads page with the option to add Python to environment variables checked.

  • How do I check if Git is installed correctly on my system?

    -After installing Git, you can open the command prompt and type 'git' to verify if it is working properly. If Git is installed correctly, the command prompt will respond with information about Git.

  • What is the process to install Stable Diffusion in Automatic1111?

    -To install Stable Diffusion in Automatic1111, visit the official repository, copy the HTTPS link from the 'code' dropdown, and use the 'git clone' command followed by the copied link in the terminal to clone the repository. Then navigate into the repo and switch to the 'sdxl' development branch using 'git switch sdxl'.

  • How do I run the Stable Diffusion XL model after installation?

    -After installation, Windows users should run the 'web_user.bat' script, while other users can run their respective scripts. This will download and install all necessary files and packages, including PyTorch. Once completed, it will start running on your local machine at localhost:7860.

  • What is the purpose of copying the 'stxl-0.9-safetospore' file to the model stable diffusion folder?

    -The 'stxl-0.9-safetospore' file contains the Stable Diffusion model that you need to use with the web UI. It should be copied to the model stable diffusion folder inside the Stable Diffusion web UI folder to enable the generation of images with Stable Diffusion XL.

  • How can I access the 'stxl-0.9-safetospore' file from the Hugging Face repository?

    -To access the 'stxl-0.9-safetospore' file, you need to fill out the necessary form on the Hugging Face repository website. Once you've been granted access, you can download the file.

  • What should I do if I encounter issues generating images with Stable Diffusion XL?

    -If you face issues generating images, you can try opening the 'use_ip.bat' script in a text editor, adding the argument 'no_halfway' to the command line args, saving the file, and running the script again.

  • How can I improve the quality of the generated images with Stable Diffusion XL?

    -To improve the quality of the generated images, you can increase the resolution to 2024 x 2024, which will result in a significant improvement in image quality.

  • What is the current memory requirement for running Stable Diffusion XL?

    -Generating images with Stable Diffusion XL currently requires more VRAM, taking around 10 to 12 GB, compared to the 8GB required by the Comfy UI.

  • Does Automatic1111 support Ensemble models like the refiner model?

    -As of the time of the script, Automatic1111 does not support Ensemble models, so you won't be able to use the refiner model, which adds incredible details to colors, faces, hands, and outfits in the generated images.

  • How can I stay updated with the latest features and fixes for Stable Diffusion XL in Automatic1111?

    -To get the latest features and fixes, make sure to run 'git pull' periodically in the sdxl branch. You can also check the comment history on GitHub to see if any new changes have been added before pulling.

Outlines

00:00

🚀 Introduction to Stable Diffusion XL and Setup Instructions

This paragraph introduces Stable Diffusion XL, a new AI image generation tool that has been officially supported in the Automatic 111 web UI. It is currently in the refining stage and not yet merged with the master branch. The user is informed about the prerequisites for using this tool, which include installing Git and Python 3.10.6. Detailed instructions are provided for installing these prerequisites on different operating systems, including Windows, and for cloning the Automatic 1111 repository to start using Stable Diffusion. The paragraph also guides the user on how to install necessary files and packages, including PiTorch, and how to set up the web UI to start generating images. Additional tips are provided to troubleshoot common issues and to optimize image quality by increasing resolution.

Mindmap

Keywords

💡Stable Diffusion XL

Stable Diffusion XL is an advanced AI image generation model that allows users to create high-quality images from textual descriptions. It is the focus of the video, which provides a step-by-step guide on how to install and use this model within the Automatic1111 web UI. The term is central to the video's theme as it represents the technology being discussed and installed.

💡Automatic1111

Automatic1111 is a web user interface that supports the integration of AI models like Stable Diffusion XL. It is mentioned as the platform where users can utilize the capabilities of Stable Diffusion XL after installation. The term is significant as it provides the context for where the Stable Diffusion XL model will be operational.

💡Git

Git is a version control system for tracking changes in source code during software development. It is identified as a prerequisite for installing Stable Diffusion XL, as it is used to clone the repository containing the necessary files for the AI model. The term is relevant as it is part of the initial setup process described in the video.

💡Python 3.10.6

Python 3.10.6 is a specific version of the Python programming language, which is required for running the Stable Diffusion XL model. The video instructs viewers to install this version of Python to ensure compatibility with the AI model. It is a key concept as it is a technical requirement for the setup.

💡Repository

A repository, in the context of the video, refers to the location where the source code and files for Automatic1111 and Stable Diffusion XL are stored. The viewers are guided to clone the repository to start the installation process. It is an important term as it is the starting point for obtaining the necessary files for the AI model.

💡Branch

In version control systems like Git, a branch represents a separate line of development. The video specifically mentions switching to the 'sdxl development' branch to access the Stable Diffusion XL features. The term is crucial as it directs users to the correct version of the code for their installation.

💡Pi Torch

Pi Torch, often referred to as PyTorch, is an open-source machine learning library based on the Torch library. It is mentioned as one of the necessary packages that will be installed along with Stable Diffusion XL. The term is significant as it is a foundational component for running the AI model.

💡Web UI

Web UI stands for Web User Interface, which in this context refers to the graphical interface of the Automatic1111 platform where users interact with the Stable Diffusion XL model to generate images. It is a key term as it is the interface through which users will operate the AI model.

💡Checkpoints

Checkpoints, in the context of machine learning, are saved states of a model that can be loaded to continue training or to perform inferences. The video instructs users to select the 'sdxl 0.9' checkpoint from the Web UI to start generating images. This term is essential as it relates to the specific version of the model that users will be using.

💡Resolution

Resolution refers to the clarity or detail of an image, often measured in pixels. The video suggests increasing the resolution to 2024 x 2024 to improve the quality of the generated images. It is a relevant concept as it directly impacts the output of the AI model.

💡Ensemble Models

Ensemble models are a type of machine learning model where multiple models are trained to reduce the generalization error. The video notes that Automatic1111 does not currently support ensemble models, which means the refiner model, known for adding details to generated images, cannot be used. This term is important as it sets expectations about the capabilities of the AI model within the platform.

💡Optimization

Optimization in the context of the video refers to the ongoing process of improving the efficiency and performance of the Stable Diffusion XL model, particularly in terms of reducing the memory requirements. It is a key concept as it relates to the future improvements expected in the official release of the model.

Highlights

Stable Diffusion XL 0.9 is officially supported in the Automatic1111 web UI, offering advanced AI-generated images.

To use Stable Diffusion XL, prerequisites include installing Git and Python 3.10.6.

Git installation is straightforward and involves downloading the installer from git.scm.com.

Python 3.10.6 installation requires adding Python to the environment variables.

Automatic1111's official repository must be cloned to install Stable Diffusion.

Switch to the 'sdxl development' branch within the repository to start using Stable Diffusion XL.

For Windows users, run the 'web user.bat' script to download and install necessary files and start the application.

The application runs locally at localhost:7860 after installation.

Copy the 'stxl 0.9 safe to store' file to the model stable diffusion folder for setup.

The Hugging Face repository provides access to the necessary files for Stable Diffusion.

Select the 'sdxl 0.9 inches tensor' from the checkpoints dropdown to process files through the web UI.

Closing and restarting the 'web user.bat' script is recommended for stability.

A quick fix for image generation issues involves adding 'no half way' to the command line args in the 'use IP batscript' file.

Increasing the resolution to 2024x2024 can significantly improve the quality of generated images.

Stable Diffusion requires more VRAM, using around 10-12 GB compared to Comfy UI's 8GB.

Optimization of VRAM usage is ongoing and expected to improve in the official release.

Auto 1111 does not currently support Ensemble models, meaning the refiner model cannot be used.

The refiner model is known for adding details to colors, faces, hands, and outfits in generated images.

Regularly run 'git pull' to update the 'sdxl' branch with the latest features and fixes.

Check the GitHub comment history for any new changes before pulling updates.

The official release of sdxl will explore running it on low VRAM devices, AMD devices, and M1/M2 MacBooks.