自动安装
- 先clone代码:
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui
- 要在不创建虚拟环境的情况下通过 pip 安装所需的包,运行:
python launch.py
手动安装
手动安装虽有些过时,但在自动安装遇到问题的时候只能用手动安装了,我的自动安装就偶尔遇到git clone超时的问题。
- 安装支持CUDA的torch
pip install torch --extra-index-url https://download.pytorch.org/whl/cu113
- 检查一下torch是否支持gpu
python -c "import torch; print(torch.cuda.is_available())"
- 克隆webui的代码
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
cd stable-diffusion-webui
- 克隆SD和CodeFormer的储存库
mkdir repositories
git clone https://github.com/CompVis/stable-diffusion.git repositories/stable-diffusion
git clone https://github.com/CompVis/taming-transformers.git repositories/taming-transformers
git clone https://github.com/sczhou/CodeFormer.git repositories/CodeFormer
git clone https://github.com/salesforce/BLIP.git repositories/BLIP
- 安装SD所需的库
pip install transformers==4.19.2 diffusers invisible-watermark --prefer-binary
- 安装k-diffusion
pip install git+https://github.com/crowsonkb/k-diffusion.git --prefer-binary
- (可选)安装GFPGAN(面部修复)
pip install git+https://github.com/TencentARC/GFPGAN.git --prefer-binary
- (可选)安装CodeFormer所需的库(面部修复)
pip install -r repositories/CodeFormer/requirements.txt --prefer-binary
- 安装webui所需的库
pip install -r requirements.txt --prefer-binary
- 更新numpy到最新版本
pip install -U numpy --prefer-binary
- 把SD的模型放到webui的models文件夹中
安装完以上步骤,打开webui:
python webui.py
碰到的问题及解决方案:
resolved_obj = getattr(resolved_obj, attr_name)
AttributeError: module 'open_clip' has no attribute 'transformer'
如果碰到open_clip no transformer的问题
解决方案:
从源码安装open_clip:
pip install git+https://github.com/mlfoundations/open_clip.git --prefer-binary
文章提供了两种方法安装稳定扩散WebUI:自动和手动。自动安装涉及gitclone和pip,但可能会遇到超时问题。手动安装包括安装CUDA支持的torch,检查GPU支持,以及分别克隆多个相关项目库。在安装过程中,提到了解决open_clip模块transformer属性缺失的问题。最后,文章列出了所有必要的安装步骤,包括安装额外的库如GFPGAN和CodeFormer,以及启动webui。
2068

被折叠的 条评论
为什么被折叠?



