Introduction
SDXL, also known as Stable Diffusion XL, is a highly anticipated open-source generative AI model that was just recently released to the public by StabilityAI. It is an upgrade from previous versions of SD like 1.5, 2.0, and 2.1, and offers significant improvements in image quality, aesthetics, and versatility.
In this article, we will guide you through the process of installing SDXL locally, allowing you to harness the power of this advanced AI model right on your own machine.
Prerequisites
Before you begin the installation process, make sure you have the following prerequisites:
- Python 3.7 or higher
- Pip package manager
- Git
- A stable internet connection
Step-by-Step Installation Guide
Step 1: Clone the Repository
Start by cloning the SDXL repository from the StabilityAI GitHub page. Open your terminal and run the following command:
git clone https://github.com/stabilityai/sdxl.git
Step 2: Create a Virtual Environment
Next, create a virtual environment to isolate the SDXL installation from your system’s Python environment. Navigate to the cloned repository’s directory and run the following command:
cd sdxl
python3 -m venv sdxl-env
Step 3: Activate the Virtual Environment
Activate the virtual environment by running the appropriate command for your operating system:
-
- For Windows:
sdxl-envScriptsactivate.bat
-
- For macOS and Linux:
source sdxl-env/bin/activate
Step 4: Install Dependencies
With the virtual environment activated, install the necessary dependencies by running the following command:
pip install -r requirements.txt
Step 5: Download Pretrained Weights
Download the pretrained weights for SDXL by running the following command:
python download_weights.py
Step 6: Run SDXL
SDXL is now successfully installed on your local machine. To generate images using SDXL, run the following command:
The refiner model works, as the name suggests, a method of refining your images for better quality. Note that for Invoke AI this step may not be required, as it’s supposed to do the whole process in a single image generation. To use the refiner model:
- Navigate to the image-to-image tab within AUTOMATIC1111 or Invoke AI.
- Change the checkpoint/model to sd_xl_refiner (or sdxl-refiner in Invoke AI).
- You can use any image that you’ve generated with the SDXL base model as the input image.
- Set the denoising strength anywhere from 0.25 to 0.6 – the results will vary depending on your image so you should experiment with this option.
python sdxl.py
Conclusion
Congratulations! You have successfully installed SDXL locally and are now ready to explore its capabilities. SDXL, the latest version of Stable Diffusion, offers significant improvements in image quality and aesthetics, making it a powerful tool for generative AI. By following the step-by-step installation guide provided in this article, you can start using SDXL and unleash your creativity with this advanced AI model.
For more information and updates on SDXL, be sure to visit the StabilityAI website and join the community.