How to install Stable Diffusion on any Windows PC
Stable DiffusionWant to know how to install Stable Diffusion on your PC? This guide breaks the process into simple-to-follow steps and helps you supercharge your creativity.
Generative AI has been the flavor of the season. Tools like ChatGPT, Google Bard (now Gemini), Adobe Firefly, and others have shown how simple prompts can create content and stunning visuals.
Like Dall-E, Stable Diffusion democratizes text-based image generation and is not resource-hungry. All you need to do is enter a prompt as detailed as possible and let the system weave its magic within minutes.
That said, it’s relatively easy to download Stable Diffusion and install it on your Windows PC if you know where to download it and key in the correct commands. This guide takes you through the entire process and system requirements, including CPU and GPUs.
Install Python
- Download Python 3.10.6 here or on the Microsoft Store.
- Run the installer and check “Add Python to PATH”. This will allow Python from the command prompt.
- Go through the setup process to get the software fully installed with any customizations you require.
- Once the installation is finished, you will see a screen with the message “Setup was successful”.
Install Git
Git is a piece of software used to manage repositories on your PC, and is widely used for software development. Getting Git installed will assist in the Stable Diffusion installation process.
- Download Git on Windows here.
- Follow the instructions on the installer once it is downloaded.
Clone Web-UI
Now, this is where it can get complicated, what we’re going to do is get the basics of the Stable Diffusion installation on your PC.
- Run “command prompt” on your PC
- Navigate to “C:\Users\X> – “X” denotes your user name.
To get there, you can also type “cd %X%” and press enter. This will get you to the right file directory. - Paste the following command into the window without quote marks.
“git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git“ - After running this command, open your file explorer and navigate to your user folder. If successful, you should have a new folder named “stable-diffusion-webui“
Download a Stable Diffusion model file
Next, you will need to get a Stable Diffusion model file, this is usually several gigabytes, and that’s totally normal, it just might take a while to install.
- Download a Stable Diffusion model file from HuggingFace here.
- Navigate to the “stable-diffusion-webui” folder we created in the previous step.
- Locate the “models” folder, and inside that, open “stable-diffusion”. Inside, there will be a text file.
- Move the previously-downloaded Stable Diffusion model file to this folder.
Set up Web-UI
Finally, you’ll need to set up Web-UI in order to finally run Stable Diffusion. Luckily, this is a relatively simple process.
- Open the “stable-diffusion-wbui” folder we created in Step 3.
- Run “webui-user.bat”
- This will open a command prompt window which will then install all of the necessary tools to run Stable Diffusion, this process can take 5-10 minutes.
- You will know when the process is completed when you see the URL “http://127.0.0.1:7860” in the command prompt window.
Run Stable Diffusion
With all of that installed, all you now need to do is open your web browser and paste “http://127.0.0.1:7860” into the address bar. This will then run Stable Diffusion in your browser.
How to use Stable Diffusion
Once you have installed Stable Diffusion on your PC using the steps we discussed above, it’s pretty to use it to generate images. Follow these steps to learn how.
- Open Stable Diffusion.
- Input a prompt on the WebUI window. This will then generate an image based on that prompt. You’ll need a powerful Nvidia or AMD graphics card in order to create the image.
- Using the UI, adjust things like the size of the image, and how many images you want the software to generate.
What is Stable Diffusion
Stable Diffusion is a piece of software with a trained dataset that can turn text prompts into AI-generated images. The generated images can be of almost anything that you can imagine, though it does require some fine prompt tuning in order to get the output that you want. It originally launched in 2022.
Stable Diffusion isn’t just for generating images; it can also create videos and animations. This software is powered by diffusion technology and operates within a latent space, which significantly lowers the processing power needed. As a result, you can run it on desktops or laptops equipped with GPUs.
Stable Diffusion is open to everyone under a permissive license. Unlike other image generation models, this one is a diffusion model. Essentially, diffusion models use Gaussian noise to encode an image. Then, they rely on a noise predictor combined with a reverse diffusion process to recreate the image.
Beyond its technical distinction as a diffusion model, Stable Diffusion stands out because it doesn’t work with the image’s pixel space. Instead, it operates in a reduced-definition latent space, setting it apart from other image-generation models.