1. 安装Python3.10.6
Python Release Python 3.10.6
The official home of the Python Programming Language

更高的版本似乎会出问题

安装时记得勾上Add Python3.10 to Path

2. 安装Git

Git - Downloading Package

3. 安装CUDA11.8

现在是6月份,pytorch支持到CUDA11.8,所以下载的这个版本

CUDA Toolkit 11.8 Downloads
Resources CUDA Documentation/Release NotesMacOS Tools Training Sample Code Forums Archive of Previous CUDA Releases FAQ Open Source PackagesSubmit a BugTarball and Zip Archive Deliverables

4. 安装 Stable Diffusion web UI

在你要安装Stable Diffusion web UI的文件夹,右键点击Git Bash Here

git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git

复制上面的命令,粘贴到Git Bash 中去回车,等待下载完成。

5. 下载模型(Check Point)

runwayml/stable-diffusion-v1-5 · Hugging Face
We’re on a journey to advance and democratize artificial intelligence through open source and open science.

或者在这里找一个你喜欢的Checkpoint下载

Civitai | Stable Diffusion models, embeddings, LoRAs and more
Civitai is a platform for Stable Diffusion AI Art models. Browse a collection of thousands of models from a growing number of creators. Join an engaged community in reviewing models and sharing images with prompts to get you started.

6. 导入模型

将第5步下载的模型复制粘贴到 Stable Diffusion Web UI下的路径:

stable-diffusion-webui\models\Stable-diffusion

7. 安装pytorch

在stable-diffusion-webui\venv\scripts目录中,运行 activate.bat,再输入以下命令然后回车:

pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

8. 运行

双击运行“webui.bat”,

首次运行会下载pytorch,2点多G,需要等一段时间。


如果下载失败,再次安装可能会报错,尝试以下方法:

在venv\Scripts\文件下右键点击Git bash here,然后按顺序输入以下命令:

./activate
pip uninstall torch torchvision torchaudio
pip cache purge
[Bug]: Error code: 2 · Issue #8810 · AUTOMATIC1111/stable-diffusion-webui
Is there an existing issue for this? I have searched the existing issues and checked the recent builds/commits What happened? Could not install torch, requests, torchvision Steps to reproduce the p…

再次双击运行“webui.bat”重新下载,直到成功


在网页上打开http://127.0.0.1:7860,可以玩耍了;