【文生图系列】Stable Diffusion Webui安装部署过程中bug汇总(Linux系统)

    <link rel="stylesheet" href="https://csdnimg.cn/release/blogv2/dist/mdeditor/css/editerView/kdoc_html_views-1a98987dfd.css">
    <link rel="stylesheet" href="https://csdnimg.cn/release/blogv2/dist/mdeditor/css/editerView/ck_htmledit_views-25cebea3f9.css">
            <div id="content_views" class="markdown_views prism-atom-one-dark">
                <svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
                    <path stroke-linecap="round" d="M5,0 0,2.5 5,5z" id="raphael-marker-block" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></path>
                </svg>
                <p></p> 

bugs

看网上部署stable diffusion webui的教程,很简单。而且我也有部署stable diffusion v1/v2的经验,想着应该会很快部署完stable diffusion webui,但是没想到在部署过程中,遇到各种各样的奇葩问题,特此在此记录一下。

虚拟环境python

stable diffusion webui支持的python版本需大于等于3.10.6,首先conda search python查看conda支持的python版本,我的conda支持到3.11,所以能够创建python=3.10.6的虚拟环境,然而却出现了如下错误。libgcc-ng等的版本不满足要求。
创建环境
我使用的是清华源解决方案就是添加conda-forge通道conda config --append channels conda-forge,能够访问https://anaconda.org下载清华源中不存在的包。

Preparing metadata (setup.py)

在pip install -r requirement_version.txt时,在下载安装basicsr库preparing metadata (setup.py)中卡住一直不动。

解决方案:首先添加–verbose参数查看卡住的原因。pip install --verbose basicsr,输出如下所示:
在这里插入图片描述
安装需满足PEP 517,首先输入如下命令pip install --upgrade pip setuptools wheel 升级setuptools的版本。然后再使用命令pip install --verbose basicsr --use-pep517 进行安装。

gfpgan和cython

首先pip install -r requirement_version.txt安装所需要的包,没出问题。检查gfpgan也已经安装成功。
在这里插入图片描述
如上图所示,gfpgan和Cython都已经安装好的情况下,运行./webui.sh,出现
Couldn't install gfpgan. Error Could not find a version that satisfies the requirement cython。这个问题试了很多方法,总会出现各种各样的bug,最后终于解决。
在这里插入图片描述

  1. 出现一个很奇怪的事情,我的python版本是3.10.6,但是运行./webui.sh时,出现的Python版本是3.8,而且venv/lib下的python也是3.8。至今也没想出来,怎么冒出来一个python3.8。解决方案就是:对比github上的stable diffusion webui项目,多了venv文件夹,那说明venv文件夹是后生成的。删除整个venv整个文件夹,重新运行./webui.sh,python版本变成3.10.6,但是上述问题gfpgan和Cython的问题仍然存在。
  2. 解决python版本的问题之后,确认python为3.10.6,注释掉modules/launch_utils.py文件中关于gfpgan安装的代码之后,运行./webui.sh,部署成功。需全部注释掉之后才可以。
    在这里插入图片描述在这里插入图片描述
    曾试过手动安装gfpgan、上述不运行run_pip函数,直接下载gfpgan,都会存在上述问题。后来一想,既然gfpgan和Cython已经安装,那么就不需要再安装gfpgan吧,既然安装过程还需要二次安装,那么注释掉吧。这样,阴差阳错就把问题解决了。

重新运行./webui.sh,等待一段时间,依序安装所需软件,部署成功。
在这里插入图片描述

clip和open_clip的安装问题,在modules/launch_utils.py中将"https://github.com/“更改为"https://kgithub.com/”。

使用xformers,在webui-user.sh中添加export COMMANDLINE_ARGS="--autolaunch --xformers"命令行。

部署环境看着简单,有时候全凭运气。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值