# stable-diffusion-webui

# stable-diffusion-webui简介

Stable Diffusion WebUI 是一个基于Gradio 库的浏览器界面，用于使用Stable Diffusion 生成图像。 Stable Diffusion WebUI 提供了一个简单易用的界面，可以让用户快速生成图像。

##### 参考资料

- [【github】 - 官方源代码](https://github.com/AUTOMATIC1111/stable-diffusion-webui)
- [【SD中文网】 - stable diffusion webui是什么？](https://www.stablediffusion-cn.com/sd/sd-knowledge/3535.html)

# 基于NVidia显卡的安装与运行

源代码[stable-diffusion-webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui)地址，具体内容请参考官方提供的[安装文档](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Install-and-Run-on-NVidia-GPUs)

##### 一、安装git

官方推荐版本[git-2.39.2](https://github.com/git-for-windows/git/releases/download/v2.39.2.windows.1/Git-2.39.2-64-bit.exe)，此处直接傻瓜式安装即可，如果你当前网络环境不能直接访问github，则参考[git代理设置](https://bookstack.freedom-yun.com/books/git/page/ef0d3)将github源代码通过代理签出与更新。

##### 二、安装python

官方推荐[Python 3.10.6](https://www.python.org/ftp/python/3.10.6/python-3.10.6-amd64.exe)，安装完成后建议[配置国内镜像源](https://bookstack.freedom-yun.com/books/python/page/pip)，加快安装效率。

##### 三、下载安装`sd.webui.zip`

下载最新版本（当前版本[`v1.0.0-pre`](https://github.com/AUTOMATIC1111/stable-diffusion-webui/releases/tag/v1.0.0-pre)），解压到本地目录，建议修改`webui\webui-user.bat`文件

```Bat
:: 指定python路径
set PYTHON=<真实的python安装路径>
:: 指定python虚拟环境（防止python环境污染）
set VENV_DIR=%~dp0\venv
```

如果你的机器上只有当前一个python项目，那么以上步骤可以不做，但为了防止一台机器上多个python项目之间的环境污染与冲突，最好还是设置一下。

```batch
:: 安装目录
set STABLE_DIFFUSION_HOME=%~dp0
:: 更新最新版本（使用git签出最新代码）
%STABLE_DIFFUSION_HOME%/update.bat
:: 启动服务，第一次运行会安装依赖，有可能会下载失败，多试几次
%STABLE_DIFFUSION_HOME%/run.bat
```

##### 参考资料

- [【Github】 - Install and Run on NVidia GPUs](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Install-and-Run-on-NVidia-GPUs)
- [【知乎】 - Stable diffusion无门槛入门 介绍、硬件、软件、界面介绍，新手无门槛入门！](https://zhuanlan.zhihu.com/p/632097106)
- [Git访问github代理设置](https://bookstack.freedom-yun.com/books/git/page/ef0d3)
- [修改pip镜像源](https://bookstack.freedom-yun.com/books/python/page/pip)

# 常用扩展插件

- [【github】 - 汉化插件](https://github.com/VinsonLaro/stable-diffusion-webui-chinese)
- [【github】 - ComfyUI（类似流程图一样的管理界面）](https://github.com/comfyanonymous/ComfyUI)
- [【github】 - ComfyUI汉化插件](https://github.com/AIGODLIKE/AIGODLIKE-ComfyUI-Translation)
- [【github】 - ComfyUI提示词中文](https://github.com/AlekPet/ComfyUI_Custom_Nodes_AlekPet)