从头体验Stable-Diffusion-Webui

3,046 阅读2分钟

安装准备

软件安装

  • 安装 Python 3.10.6,选中"将 Python 添加到 PATH"
  • 克隆 stable-diffusion-webui 代码到本地 git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
  • 进入目录 stable-diffusion-webui 执行安装文件 webui-user.bat

插件安装

本地化

点击 Extension 选项卡,点击 Install from URL 子选项卡 复制本 git 仓库网址: github.com/dtlnor/stab… 粘贴进 URL 栏,点击 Install

CivitAI

  • 在 Automatic1111 SD Web UI 中打开扩展选项卡
  • 在扩展选项卡中打开“从 URL 安装”选项卡
  • 粘贴https://github.com/civitai/sd_civitai_extension.git到 URL 输入安装并等待它完成
  • 重新启动 Automatic1111(重新加载 UI 将不会安装必要的要求)

additional networks

github.com/kohya-ss/sd…

ControlNet

github.com/Mikubill/sd…

OpenOutpaint

github.com/zero01101/o…

魔法练习

元素发电 docs.qq.com/doc/DWHl3am…

标签超市 tags.novelai.dev/

Emoji www.emojiall.com/zh-hans

常见问题

执行 webui-user.bat 报错提示 pip install

 venv "D:\stable-diffusion-webui-master\venv\Scripts\Python.exe"
Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 18:41:36) [MSC v.1900 64 bit (AMD64)]
Commit hash: <none>
Installing torch and torchvision
Traceback (most recent call last):
  File "launch.py", line 108, in <module>
    run(f'"{python}" -m {torch_command}', "Installing torch and torchvision", "Couldn't install torch")
  File "launch.py", line 55, in run
    raise RuntimeError(message)
RuntimeError: Couldn't install torch.
Command: "D:\stable-diffusion-webui-master\venv\Scripts\python.exe" -m pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 --extra-index-url https://download.pytorch.org/whl/cu113
Error code: 1
stdout: Collecting torch==1.12.1+cu113

stderr:   Cache entry deserialization failed, entry ignored
  Could not find a version that satisfies the requirement torch==1.12.1+cu113 (from versions: 1.7.0, 1.10.0+cu113, 1.10.1+cu113, 1.10.2+cu113)
No matching distribution found for torch==1.12.1+cu113
You are using pip version 9.0.1, however version 22.2.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.


从文件夹中删除 venv 文件夹。再次启动 webui-user.bat,它应该可以正常工作。 segmentfault.com/q/101000004…

执行 webui-user.bat 中途拉取代码失败

基本是git无法访问github引起的 ,控制台配置下git的代理


//设置全局代理
//http
git config --global https.proxy http://127.0.0.1:7890
//https
git config --global https.proxy https://127.0.0.1:7890
//使用socks5代理的 例如ss,ssr 1080是windows下ss的默认代理端口,mac下不同,或者有自定义的,根据自己的改
git config --global http.proxy socks5://127.0.0.1:7890
git config --global https.proxy socks5://127.0.0.1:7890

//只对github.com使用代理,其他仓库不走代理
git config --global http.https://github.com.proxy socks5://127.0.0.1:7890
git config --global https.https://github.com.proxy socks5://127.0.0.1:7890
//取消github代理
git config --global --unset http.https://github.com.proxy
git config --global --unset https.https://github.com.proxy

//取消全局代理
git config --global --unset http.proxy
git config --global --unset https.proxy

参考资料

zhuanlan.zhihu.com/p/610298913

zhuanlan.zhihu.com/p/607892849

github.com/hua1995116/…