Install Stable Diffusion on Windows: Step-by-Step
In this article
Yes, you can install Stable Diffusion on Windows, and the easiest way is to use a one-click installer called Stable Diffusion WebUI (Automatic1111). This guide walks you through installing it locally on your PC, so you can generate images from text prompts without any cloud service. You'll need a Windows PC with a dedicated NVIDIA GPU (ideally 6GB+ VRAM), at least 16GB of RAM, and about 10GB of free disk space. If you have an AMD or Intel GPU, the process is more involved and not covered here.
What You'll Need
- Windows 10 or 11 (64-bit)
- An NVIDIA graphics card with at least 6GB VRAM (8GB+ recommended)
- At least 16GB of system RAM
- About 10GB of free disk space (more if you download many models)
- Python 3.10.6 (exact version matters; newer versions may cause issues)
- Git for Windows
- A stable internet connection to download files
Step-by-Step
- Install Python 3.10.6. Go to the official Python downloads page and download the Windows installer for Python 3.10.6 (64-bit). Run the installer. Important: Check the box that says "Add Python to PATH" before clicking Install Now. If you already have a different Python version, uninstall it first or use the "Customize installation" option to install 3.10.6 alongside, but the PATH must point to 3.10.6.
- Install Git for Windows. Download the Git installer from the official Git website and run it. Accept the default settings; just keep clicking Next until it finishes.
- Open a Command Prompt or PowerShell window. Press
Win + R, typecmd, and press Enter. - Create a folder for Stable Diffusion. In the command prompt, type
mkdir stable-diffusionand press Enter, then typecd stable-diffusionand press Enter. This creates and enters a new folder on your C: drive. - Clone the WebUI repository. Type the following command and press Enter:
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git. This downloads the main program files. It may take a few minutes. - Navigate into the cloned folder. Type
cd stable-diffusion-webuiand press Enter. - Run the installation script. Type
webui-user.batand press Enter. This script will download and install all required Python dependencies, set up a virtual environment, and download the default model (Stable Diffusion 1.5) automatically. The first run can take 10–30 minutes depending on your internet speed. - Wait for the installation to finish. You'll see a lot of text scrolling by. When it's done, the script will automatically launch the WebUI in your default browser at
http://127.0.0.1:7860. If it doesn't open, just type that address into your browser manually. - Start generating. You should see the Stable Diffusion WebUI interface. In the "Prompt" text box, type something like "a cat wearing a wizard hat" and click the "Generate" button. After a few seconds, you'll see your first image.
- Shut down properly. To stop the server, close the command prompt window or press
Ctrl + Cin it. The next time you want to use Stable Diffusion, navigate to thestable-diffusion-webuifolder and double-clickwebui-user.batagain.
Common Mistakes
- Not adding Python to PATH. If you skip that checkbox, the script won't find Python and will fail with a "Python not found" error.
- Using a newer Python version. Python 3.11 or 3.12 often breaks dependencies. Stick with 3.10.6 for a smooth install.
- Running the script from the wrong folder. You must run
webui-user.batfrom inside thestable-diffusion-webuifolder, not from your home directory. - Insufficient VRAM. If you have a 4GB GPU, you'll likely run out of memory when generating images. You can try adding
--lowvramto the command line inwebui-user.bat, but results will be slow and may still crash. - Interrupting the first run. Let the script finish downloading models and dependencies. Closing the window early can corrupt the installation.
Tips
- Use a model you like. The default model is good, but you can download community models from sites like Hugging Face or Civitai. Place them in the
models/Stable-diffusionfolder inside the WebUI directory, then refresh the model dropdown in the UI. - Save your prompts. Use the "Save" button next to the prompt box to store your favorite prompts for reuse.
- Increase image resolution. The default is 512x512. You can change the width and height in the UI, but higher resolutions require more VRAM.
- Use the built-in upscaler. The "Extras" tab has an upscaler that can enlarge images without losing quality.
- Backup your models. If you download custom models, copy them to a separate folder so you don't lose them if you reinstall.
Troubleshooting
If the installation fails or the WebUI doesn't start, try these in order:
- Check the command prompt output. Look for the error message. Common ones include "Python not found" or "pip is not recognized." If so, reinstall Python and make sure you checked "Add to PATH."
- Update your GPU drivers. Go to NVIDIA's website and install the latest driver for your GPU. Outdated drivers can cause CUDA errors.
- Restart your PC. Sometimes a simple restart clears up file locks or environment variable issues.
- Delete the
venvfolder and retry. Inside thestable-diffusion-webuifolder, there's avenvfolder. Delete it, then runwebui-user.batagain. This forces a fresh install of dependencies. - Run the script as Administrator. Right-click the command prompt and select "Run as administrator," then run
webui-user.bat. This can fix permission issues. - Check if your GPU is supported. If you have an AMD or Intel GPU, the script will fail because it expects NVIDIA CUDA. You can try the
--use-directmlflag inwebui-user.bat, but that's an advanced workaround and may not work well. - If the browser doesn't open, type
http://127.0.0.1:7860manually. If that doesn't work, check the command prompt for the actual URL (it might be a different port). - If you get a "RuntimeError: CUDA out of memory", lower the image size to 512x512 or use the
--lowvramflag inwebui-user.bat(edit the file in Notepad, add--lowvramto theCOMMANDLINE_ARGSline, save, and run again).
Frequently Asked Questions
Do I need an NVIDIA GPU?
Yes, the easiest method requires an NVIDIA GPU with CUDA support. AMD and Intel GPUs can work with extra setup (using DirectML), but that's more complex and not covered here.
How much disk space do I need?
At least 10GB. The program itself takes about 2GB, and the default model is about 4GB. Additional models can be 2-7GB each.
Can I run Stable Diffusion without a GPU?
Technically yes, but it's extremely slow (minutes per image) and not practical. The WebUI requires a GPU for reasonable performance.
How do I update Stable Diffusion WebUI?
Open a command prompt in the stable-diffusion-webui folder and run git pull. Then run webui-user.bat again to install any new dependencies.
Is it safe to download models from the internet?
Only download models from trusted sources like Hugging Face or Civitai. Some models may contain malicious code. Always scan files with antivirus software before using them.
Can I use this for commercial projects?
It depends on the model's license. The default Stable Diffusion 1.5 model is released under a permissive license, but some community models have restrictions. Check the model card for details.