Stable Diffusion local installation steps

Stable Diffusion is an open source machine learning model that can generate images from text, modify images based on text, or fill in details on low-resolution or low-detail images.

Stable Diffusion has been trained on billions of images and can produce results comparable to those obtained from DALL-E 2 and MidJourney. It was developed by Stability AI and first publicly released on August 22, 2022.

Stable Diffusion is completely free to use on Windows computers .

This article introduces the detailed installation steps of Stable Diffusion on the Windows 11 operating system.

  1. Install Python

The community recommends installing Python 3.10.6, but the author installed 3.10.8:

You can download Python directly through this link .

Open the Stable Diffusion Github repository :

Click Code->Download Zipto download it locally:

Download it locally and unzip it.
https://huggingface.co/CompVis/stable-diffusion-v-1-4-original

Start the log, it will be automatically downloaded torchand torchvision:

Wait patiently for it to download:

If you encounter the following error message when starting:

File “C:\app\stable-diffusion-webui-master\launch.py”, line 355, in
prepare_environment()
File “C:\app\stable-diffusion-webui-master\launch.py”, line 260, in prepare_environment
run_python(“import torch; assert torch.cuda.is_available(), ‘Torch is not able to use GPU; add --skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check’”)
File “C:\app\stable-diffusion-webui-master\launch.py”, line 121, in run_python
return run(f’“{python}” -c “{code}”', desc, errdesc)
File “C:\app\stable-diffusion-webui-master\launch.py”, line 97, in run
raise RuntimeError(message)
RuntimeError: Error running command.
Command: “C:\app\stable-diffusion-webui-master\venv\Scripts\python.exe” -c “import torch; assert torch.cuda.is_available(), ‘Torch is not able to use GPU; add --skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check’”
Error code: 1
stdout:
stderr: C:\app\stable-diffusion-webui-master\venv\lib\site-packages\torch\cuda_init_.py:88: UserWarning: CUDA initialization: The NVIDIA driver on your system is too old (found version 10020). Please update your GPU driver by downloading and installing a new version from the URL: http://www.nvidia.com/Download/index.aspx Alternatively, go to: https://pytorch.org to install a PyTorch version that has been compiled with your version of the CUDA driver. (Triggered internally at …\c10\cuda\CUDAFunctions.cpp:109.)
return torch._C._cuda_getDeviceCount() > 0
Traceback (most recent call last):
File “”, line 1, in
AssertionError: Torch is not able to use GPU; add --skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check

https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/1742

https://github.com/TencentARC/GFPGAN

Follow the error message to correct it:

Found the exact address where this error message was reported:

Started successfully:

Guess you like

Origin blog.csdn.net/i042416/article/details/133442599