先决条件:
a.下载git
https://git-scm.com/download/win
b.如果使用GPU,需要使用cuda,本文档对GPU环境不做讨论
https://developer.nvidia.com/cuda-toolkit-archive
注:CUDA版本需要和torch版本匹配
https://pytorch.org/get-started/locally/
1.下载conda
https://docs.conda.io/en/latest/miniconda.html
2.打开miniconda, 执行下列命令
conda config --set show_channel_urls yes
conda clean -i
conda create --name sdenv python=3.10.6
conda env list
conda activate sdenv
3.依赖环境安装
python -m pip install --upgrade pip
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
来到你准备部署SD的目录,执行git
git clone GitHub - AUTOMATIC1111/stable-diffusion-webui
cd stable-diffusion-webui
参照https://pytorch.org/get-started/locally/
选择windows, pip, python,cpu,会自动得出安装脚本
pip3 install torch torchvision torchaudio
4.安装模型及相应组件放入models\Stable-diffusion文件夹
# Stable diffusion v1.4
https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt
# Stable diffusion v1.5
https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.ckpt
# F222
https://huggingface.co/acheong08/f222/resolve/main/f222.ckpt
# Anything V3
https://huggingface.co/Linaqruf/anything-v3.0/resolve/main/anything-v3-fp16-pruned.safetensors
# Open Journey
https://huggingface.co/prompthero/openjourney/resolve/main/mdjrny-v4.ckpt
# DreamShaper
https://civitai.com/api/download/models/5636
# ChilloutMix
https://civitai.com/api/download/models/11745
# Robo Diffusion
https://huggingface.co/nousr/robo-diffusion/resolve/main/models/robo-diffusion-v1.ckpt
# Mo-di-diffusion
https://huggingface.co/nitrosocke/mo-di-diffusion/resolve/main/moDi-v1-pruned.ckpt
# Inkpunk Diffusion
https://huggingface.co/Envvi/Inkpunk-Diffusion/resolve/main/Inkpunk-Diffusion-v2.ckpt
以下放入models/Lora文件夹
https://huggingface.co/amornlnw7/koreanDollLikeness_v15/resolve/main/koreanDollLikeness_v15.safetensors
https://huggingface.co/samle/sd-webui-models/resolve/main/povImminentPenetration_ipv1.safetensors
https://huggingface.co/jomcs/NeverEnding_Dream-Feb19-2023/resolve/main/lora/breastinclassBetter_v14.safetensors
前往以下链接下载所有文件,放入openai\clip-vit-large-patch14文件夹
https://huggingface.co/openai/clip-vit-large-patch14/tree/main
5.启动
编辑目录下的webui.bat文件,修改如下这一行
set COMMANDLINE_ARGS=--skip-torch-cuda-test --no-half --precision full --use-cpu all --listen
6.参考链接
https://zhuanlan.zhihu.com/p/613530403
https://zhuanlan.zhihu.com/p/626006585
https://zhuanlan.zhihu.com/p/621279140
https://zhuanlan.zhihu.com/p/622263109
https://www.bilibili.com/read/cv21987039
https://zhuanlan.zhihu.com/p/666288849