自学内容网 自学内容网

ubuntu 系统下,安装stable diffusion解决下载速度慢的问题

在Ubuntu系统下,安装过程中需要下载大量的文件,如果直接从GitHub下载,可能会因为网络问题导致失败。中国大陆地区可以使用清华大学提供的镜像源来加速下载。

首先,你需要确保已经安装了git和curl。如果没有安装,可以使用以下命令安装:

sudo apt update
sudo apt install git curl

然后,你可以使用以下命令来下载并安装Stable Diffusion的Web UI:

cd ~
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
cd stable-diffusion-webui
git checkout webui-v4.9.1 # 切换到稳定的版本
 
# 修改install.sh文件,使用清华大学的镜像源
sed -i 's/https:\/\/github.com\//\/\/git.code.tencent.com\/'\
'/stable-diffusion-webui\//g' install.sh
 
# 修改webui.sh文件,使用清华大学的镜像源
sed -i 's/https:\/\/github.com\//\/\/git.code.tencent.com\/'\
'/stable-diffusion-webui\//g' webui.sh
 
# 修改download_dependencies.sh文件,使用清华大学的镜像源
sed -i 's/https:\/\/github.com\//\/\/git.code.tencent.com\/'\
'/stable-diffusion-webui\//g' download_dependencies.sh
 
# 修改download_model.sh文件,使用清华大学的镜像源
sed -i 's/https:\/\/huggingface.co\//\/\/huggingface.bj.bcebos.com\/'\
'/stable-diffusion-webui\//g' download_model.sh
 
# 修改prereqs.sh文件,使用清华大学的镜像源
sed -i 's/https:\/\/github.com\//\/\/git.code.tencent.com\/'\
'/stable-diffusion-webui\//g' prereqs.sh
 
# 修改download_models.sh文件,使用清华大学的镜像源
sed -i 's/https:\/\/github.com\//\/\/git.code.tencent.com\/'\
'/stable-diffusion-webui\//g' download_models.sh
 
# 修改download_prompts.sh文件,使用清华大学的镜像源
sed -i 's/https:\/\/github.com\//\/\/git.code.tencent.com\/'\
'/stable-diffusion-webui\//g' download_prompts.sh
 
# 修改download_ui.sh文件,使用清华大学的镜像源
sed -i 's/https:\/\/github.com\//\/\/git.code.tencent.com\/'\
'/stable-diffusion-webui\//g' download_ui.sh
 
# 修改download_repositories.sh文件,使用清华大学的镜像源
sed -i 's/https:\/\/github.com\//\/\/git.code.tencent.com\/'\
'/stable-diffusion-webui\//g' download_repositories.sh
 
# 修改download_repositories_and_models.sh文件,使用清华大学的镜像源
sed -i 's/https:\/\/github.com\//\/\/git.code.tencent.com\/'\
'/stable-diffusion-webui\//g' download_repositories_and_models.sh
 
# 修改download_repositories_and_models_v2.sh文件,使用清华大学的镜像源
sed -i 's/https:\/\/github.com\//\/\/git.code.tencent.com\/'\
'/stable-diffusion-webui\


原文地址:https://blog.csdn.net/jiao_zg/article/details/142472918

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!