AI大模型教程
一起来学习

Stable Diffusion webui安装过程及问题解决(Windows)

很久前自己装过SDwebui用来AI绘画,今天帮朋友在他的笔记本上安装,以下记录一下安装大体过程及问题解决


安装过程

安装过程按照https://github.com/AUTOMATIC1111/stable-diffusion-webui的指引就好

 

  1. 安装python3.10.6

  2. 安装git

  3. git clone仓库(注意,不要用下载解压zip的方法,可能出现问题)

  4. 运行webui-user.bat,等待(不要管理员运行)


问题及解决方法

webui-user.bat脚本首次运行时先配置环境,下载需要的包并clone需要的仓库代码。在这个过程中可能因为网速等原因造成运行失败,可按如下方法解决:

  • torch下载缓慢或异常中断

在阿里云镜像网站上下载whl并离线安装,亲测很快

https://mirrors.aliyun.com/pytorch-wheels/cu121/?spm=a2c6h.25603864.0.0.7b5d6223CUU5wj

将下载好的whl放在stable_diffusion/venv/Scripts下,在该目录下打开cmd,运行activate命令启动虚拟环境,然后运行 pip install torch-2.1.2+cu121-cp310-cp310-win_amd64.whl

安装好后再次运行webui-user.bat脚本即可

(应用延伸:pip安装torch_gpu太慢的解决方案;项目特有虚拟环境的使用)

  • git clone异常中断

打开stable_diffusion/modules/launch_utils.py

更改其中部分卡顿的git仓库的url,添加代理

示例更改部分如下(添加加粗的部分):

stable_diffusion_repo = os.environ.get(‘STABLE_DIFFUSION_REPO’, “https://ghproxy.com/https://github.com/Stability-AI/stablediffusion.git”)
    stable_diffusion_xl_repo = os.environ.get(‘STABLE_DIFFUSION_XL_REPO’, “https://ghproxy.com/https://github.com/Stability-AI/generative-models.git”)
    k_diffusion_repo = os.environ.get(‘K_DIFFUSION_REPO’, ‘https://ghproxy.com/https://github.com/crowsonkb/k-diffusion.git’)
    blip_repo = os.environ.get(‘BLIP_REPO’, ‘https://ghproxy.com/https://github.com/salesforce/BLIP.git’)

保存后再次运行webui-user.bat脚本即可,稍慢但不会异常中断

(应用延伸:git clone太慢的解决方案)

  • 默认下载的原版stable diffusion checkpoint下载太慢

在civitai网站提前下载一个checkpoint模型放入stable_diffusion/models/Stable_Diffusion使用即可,默认的模型下载过慢会终止并自动跳过,无需处理

 

 

 

文章来源于互联网:Stable Diffusion webui安装过程及问题解决(Windows)

相关推荐: 除了DeepSeek,原来还有这些超好用的宝藏国产ai写作软件

2025可能真是国产AI大模型崛起之年! 当大家还在讨论ChatGPT时,国产AI工具已经悄悄进化成”六边形战士”。它们不仅会写爆款文案、改毕业论文,还能陪你深夜emo写诗,甚至给老板的周报加上彩虹屁特效。 今天就带大家盘点6款风格迥异的国内宝藏ai写作智能生…

赞(0)
未经允许不得转载:5bei.cn大模型教程网 » Stable Diffusion webui安装过程及问题解决(Windows)
分享到: 更多 (0)

AI大模型,我们的未来

小欢软考联系我们