Linux Ubuntu 云端部署Stable Diffusion WebUI
猫王Online
2023年11月30日 20:51
收录于文集
共2篇

安装教程视频:网页链接​

安装流程如下:

1、如果是使用腾讯云,默认会使用腾讯镜像。我建议先改为阿里镜像,经过多次实践发现腾讯镜像很多扩展包是找不到的,不建议大家使用。(使用页面登录服务器,修改/home/ubuntu/.pydistutils.cfg和/home/ubuntu/.pip/pip.conf,将里面的tencentyun替换为aliyun即可)

2、下载conda:wget https://repo.anaconda.com/archive/Anaconda3-2023.07-1-Linux-x86_64.sh --no-check-certificate

3、安装conda:bash Anaconda3-2023.07-1-Linux-x86_64.sh

4、执行:source ~/.bashrc

5、更新环境:conda update -n base -c defaults conda

6、创建环境:conda create -n sd python=3.10 && source activate sd

7、下载WebUI(国内用代理):git clone https://mirror.ghproxy.com/https://github.com/AUTOMATIC1111/stable-diffusion-webui

8、编辑配置替换国内镜像:vi stable-diffusion-webui/modules/launch_utils.py

9、进入目录并启动安装:cd stable-diffusion-webui && ./webui.sh --theme dark --listen --upcast-sampling --no-half-vae --disable-nan-check --xformers --port 7860

10、执行成功后会看到去huggingface下载模型,如果没有代理的话是下载不了的。这时按Ctrl + c退出,直接去liblib.ai那找模型然后下载放到 models/Stable-diffusion/ 就行了

安装遇到的问题和解决办法如下:

1、ImportError: libGL.so.1: cannot open shared object file: No such file or directory

解:需要安装依赖

执行命令:sudo apt-get install libgl1

2、OSError: Can't load tokenizer for 'openai/clip-vit-large-patch14'.

解:主要是国内访问不了huggingface站点了,所以下载不了对应的模型,为了之后使用不再出现类似的错误,你们可以直接按我的方法就行了。

下载猫老师的huggingface文件夹,把它放入到 ~/.cache 目录解压,然后再启动就行了。

下载链接:huggingface.zip

https://www.alipan.com/s/5ZPTu5x9UGs

提取码: gj32

安装对应的插件 扩展地址

a1111-sd-webui-tagcomplete https://gitcode.net/ranting8323/a1111-sd-webui-tagcomplete

adetailer https://gitcode.net/ranting8323/adetailer.git

multidiffusion-upscaler-for-automatic1111 https://gitcode.net/ranting8323/multidiffusion-upscaler-for-automatic1111.git

sd-dynamic-thresholding https://gitcode.net/ranting8323/sd-dynamic-thresholding.git

sd-webui-3d-open-pose-editor https://ghproxy.com/https://github.com/nonnonstop/sd-webui-3d-open-pose-editor.git

sd-webui-controlnet https://gitcode.net/ranting8323/sd-webui-controlnet

sd-webui-infinite-image-browsing https://gitcode.net/ranting8323/sd-webui-infinite-image-browsing

sd-webui-inpaint-anything https://gitcode.net/ranting8323/sd-webui-inpaint-anything.git

sd-webui-model-converter https://gitcode.net/ranting8323/sd-webui-model-converter

sd-webui-openpose-editor https://gitcode.net/ranting8323/sd-webui-openpose-editor

sd-webui-prompt-all-in-one https://gitcode.net/ranting8323/sd-webui-prompt-all-in-one

sd-webui-segment-anything https://gitcode.net/ranting8323/sd-webui-segment-anything.git

sd-webui-supermerger https://gitcode.net/ranting8323/sd-webui-supermerger.git

stable-diffusion-webui-localization-zh_Hans https://gitcode.net/overbill1683/stable-diffusion-webui-localization-zh_Hans

stable-diffusion-webui-model-toolkit https://gitcode.net/ranting8323/stable-diffusion-webui-model-toolkit.git

stable-diffusion-webui-wd14-tagger https://gitcode.net/ranting8323/stable-diffusion-webui-wd14-tagger

ultimate-upscale-for-automatic1111 https://gitcode.net/ranting8323/ultimate-upscale-for-automatic1111.git