Do you want to create amazing images from text using the power of AI? If so, you might be interested in Stable Diffusion, a cutting-edge open-source deep learning model that can generate realistic and detailed visuals from natural language. However, you might be wondering how to install and use this AI model on your Windows system.
Don’t worry, we’ve got you covered! This guide will show you how to install Stable Diffusion on your Windows PC in a few easy steps. By the end of this guide, you’ll be able to run Stable Diffusion on your own PC and enjoy the magic of AI-generated images. Let’s get started!
What is Stable Diffusion?
Stable Diffusion is an open-source deep learning model developed by a startup named Stability AI in collaboration with some academic researchers and non-profit organizations. This model, created in 2019 and released in 2022, is designed to generate high-quality, detailed images from text inputs.
Its primary function involves transforming text descriptions into visually compelling images. Additionally, Stable Diffusion also offers the ability to modify existing images using text or fill in details for low-resolution images, providing a versatile tool for both artistic expression and problem-solving.
How Does Stable Diffusion Work?
The Stable Diffusion model belongs to the category of deep learning models known as diffusion models. Specifically, these models fall under the umbrella of generative models, which implies they’re trained to produce new data resembling what they’ve learned from previous information.
In a broader context, generative modeling is a branch of unsupervised learning that focuses on autonomously recognizing and understanding patterns within input data. This allows the model to generate new examples that could feasibly belong to the original dataset.
How to Install Stable Diffusion on Windows
Here we will install and configure the most popular Stable Diffusion WebUI named Automatic1111. Using this WebUI you do various activities like image generation, image editing with inpainting, extending image, ultra resolution and many more. Recently we have Stable Diffusion turbo, by which you can see real time image generation as you type.
Now we can glide into the installation and setup of Stable Diffusion in Windows.
To kickstart this process, ensure your system meets the following prerequisites:
- Operating System: Windows 10 or higher.
- GPU: Discrete Nvidia card with 4 GB VRAM or more (Integrated GPUs are not supported).
For those unable to meet these requirements, alternative options include utilizing fully managed services like Think Diffusion’s A1111 service, leveraging cloud services such as Google Colab, or considering Mac Apple Silicon M1/M2.
Step 1: Python Installation
Begin by installing Python 3.10.6. Follow these options:
- Option 1: Install from the Microsoft Store.
- Option 2: Use the 64-bit Windows installer from the Python website (Ensure to select “Add Python 3.10 to PATH” during installation).
We suggest installing Python from the Microsoft Store for a smoother process. To begin, it’s essential to uninstall any previously installed Python versions. You can do this by navigating to the Control Panel and selecting “Add or remove programs.”
Next, go to the Microsoft Store and locate Python 3.10. Install the Python software from there.
To verify if the installation was successful, follow these steps:
- Press the Windows key on your keyboard and search for “cmd” to find the Command Prompt program.
- Open the Command Prompt.
- In the Command Prompt window, type “python” and press Enter. You should see a response confirming Python 3.10 is running.
If Python 3.10 doesn’t appear as expected, consider the following troubleshooting steps:
- Restart your PC.
- Uninstall any previous Python versions and try reinstalling from the Microsoft Store.
- If the Microsoft Store version doesn’t work, uninstall it and attempt installation using the version from the Python website.
Please ensure Python 3.10 is correctly installed and running before proceeding to the next steps.
Step 2: Git Installation
Git is a system used for managing code repositories. To install and update AUTOMATIC1111, you’ll require Git. Visit this page to download the Windows version of Git. Once downloaded, run the installer. Proceed by clicking “Install” to accept the license terms and install the software. Follow the on-screen instructions to finalize the installation process.
Step 3: Clone web-ui
To download the Stable Diffusion software (AUTOMATIC1111), follow these steps:
- Press the Windows key (located to the left of the space bar) to open the search window. Type “cmd”.
- Click on “Command Prompt” to open the command prompt window.
- Ensure you’re in your home folder by typing the following command and pressing Enter (you can paste using right-click in Command Prompt):
Your prompt should display something like
- Next, enter the following command and press Enter to clone the AUTOMATIC1111 repository:
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
This command will create a folder named
stable-diffusion-webui in your home directory.
Step 4: Download Model File
After creating the folder named
stable-diffusion-webui in your home directory, follow these steps:
- Open File Explorer and navigate to the folder by entering the following path in the address bar:
- Within the
stable-diffusion-webuifolder, locate and enter the
- Inside the
modelsdirectory, find the
Stable-diffusionfolder. You should see a file named
Put Stable Diffusion checkpoints here.txt.
- Download the
Stable Diffusion v1.5model checkpoint file from the provided download link.
- Move or copy the downloaded
Stable Diffusion v1.5model checkpoint file into the
Stable-diffusionfolder within the
Step 5: Run webui
To complete the installation and run the Stable Diffusion software (AUTOMATIC1111), follow these steps:
- In File Explorer, navigate to the
stable-diffusion-webuifolder by entering the following path in the address bar:
- Look for a file named
- Double-click on the
webui-user.batfile to initiate the installation process. This step might take some time to complete.
- Once the installation finishes, you will see a message similar to:
Running on local URL: http://127.0.0.1:7860
- Open your web browser and go to the following URL:
- You should now see the AUTOMATIC1111 web user interface (webui). Enter a prompt and click on “Generate” to test if Stable Diffusion is functioning correctly.
- When you’re finished using Stable Diffusion, simply close the Command Prompt window to shut down the application.
To restart Stable Diffusion, double-click on the
webui-user.bat file again.
In this article, you have learned how to install Stable Diffusion on Windows, a cutting-edge AI model that can generate realistic and detailed images from natural language. We have followed the installation steps step by step, using Python 3.10.6 as the programming language.
You have also learned how to run Stable Diffusion and access its web user interface, where we can enter prompts and generate images. By following this article, we have successfully set up Stable Diffusion on our Windows system and can enjoy the benefits of AI text generation.