在linux系统上运行Stable Diffusion web UI

stable-diffusion-webui项目地址

该项目是一个针对Stable Diffusion模型的浏览器操作界面,基于Gradio

环境: 在恒源云上租的服务器,操作系统:Ubuntu、显卡:A4000-16G。恒源云官网链接

项目的Readme.md让我们用webui.sh配置项目,但是各种Bug。。。只能自己弄了。


# 更新一下pip
pip install --upgrade pip
# 克隆项目
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git

# 从huggingface官网里下载别人训练好的ckpt模型,放到models/Stable-diffusion目录下面
# 推荐模型: https://huggingface.co/Envvi/Inkpunk-Diffusion
#          https://huggingface.co/elontrump/nice/tree/main
# 在"恒源云"中,模型上传建议使用oss命令工具,具体操作参考官方文档

# 接着, 进入项目
cd stable-diffusion-webui/
# 直接运行launch.py文件,各种依赖包会自动安装
# --share参数表示Gradio会提供的一个公网地址用来访问,--xformers用来显存优化、加速推理
# 可以用python launch.py -h查看参数
python launch.py --share --xformers

 效果如下图:

 访问上面的public URL 


报错1:

  File "/usr/local/lib/python3.8/dist-packages/cv2/gapi/__init__.py", line 301, in <module>
    cv.gapi.wip.GStreamerPipeline = cv.gapi_wip_gst_GStreamerPipeline
AttributeError: partially initialized module 'cv2' has no attribute 'gapi_wip_gst_GStreamerPipeline' (most likely due to a circular import)

解决:直接修改/usr/local/lib/python3.8/dist-packages/cv2/gapi/__init__.py文件,把cv.gapi.wip.GStreamerPipeline = cv.gapi_wip_gst_GStreamerPipeline 这行注释掉。

报错2:

Please check your internet connection. This can happen if your antivirus software blocks the download of this file. You can install manually by following these steps: 
 
1. Download this file: https://cdn-media.huggingface.co/frpc-gradio-0.2/frpc_linux_amd64
2. Rename the downloaded file to: frpc_linux_amd64_v0.2
3. Move the file to this location: /usr/local/lib/python3.11/site-packages/gradio

解决:根据提示来就行,先下好frpc_linux_amd64,重命名为frpc_linux_amd64_v0.2,并传到/usr/local/lib/python3.11/site-packages/gradio。

报错3:

Could not create share link. Please check your internet connection or our status page: https://status.gradio.app.

解决:给frpc_linux_amd64_v0.2文件加可执行权限

chmod +x /usr/local/lib/python3.11/site-packages/gradio/frpc_linux_amd64_v0.2

报错4:

File "/usr/local/lib/python3.11/dist-packages/xformers/ops/fmha/dispatch.py", line 63, in _run_priority_list
        raise NotImplementedError(msg)
    NotImplementedError: No operator found for `memory_efficient_attention_forward` with inputs:

解决:不去设置--xformers

python launch.py --share

脸部修复插件ADetailer安装:

 

 重启,添加 --enable-insecure-extension-access 参数

python launch.py --share --enable-insecure-extension-access

stable diffusion免费尝试网站

Stable Diffusion 2-1 - a Hugging Face Space by stabilityai

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

漂流の少年

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值