1.创建虚拟环境
conda create -n stable python=3.10.6
2.克隆项目
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui
或者
 git clone https://kgithub.com/AUTOMATIC1111/stable-diffusion-webui
 3.安装依赖(-i https://pypi.tuna.tsinghua.edu.cn/simple 清华源安装)
cd ./stable-diffusion-webui
pip install -r requirements_versions.txt
pip install -r requirements.txt 4.创建启动脚本
vim start.sh
#!/bin/bash
  
export COMMANDLINE_ARGS="--xformers --deepdanbooru --port 7890 --theme dark --share "
 
python_cmd="python"
LAUNCH_SCRIPT="launch.py"
 
"${python_cmd}" "${LAUNCH_SCRIPT}" "$@"
 1)首先会遇到安装pip install -i https://pypi.tuna.tsinghua.edu.cn/simple basicsr==1.4.2卡住的问题
下面的办法解决
 在pip安装的时候添加--verbose参数查看卡住的详细原因
2)执行start.sh的时候找不到的问题
chmod +x start.sh
 再执行就可以执行了
3)但是它会安装的很慢,甚至是安装失败
- 打开 launch.py
- 按一下 esc进入命令模式
- 输入 /github后回车
- 在 launch_utils.py中找到prepare_environment()函数,将其中涉及到 github 仓库的依赖,全部添加 https://mirror.ghproxy.com/ 镜像,如下所示
 
然后如果你在xformer卡住,就退出手动安装
pip install xformers -i https://pypi.tuna.tsinghua.edu.cn/simple
4)然后是TypeError: AsyncConnectionPool.__init__() got an unexpected keyword argument 'socket_options'的报错
            pip install httpx==0.24.1 --force-reinstall
5)ModuleNotFoundError: No module named 'torchvision.transforms.functional_tensor'
open ./stable-diffusion-webui/venv/lib/python3.10/site-packages/basicsr/data/degrad


















