«

在linux系统上运行Stable Diffusion web UI

WAP站长网 发布于 阅读:34 SEO教程


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

报错 

  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 这行注释掉。

# 重新运行,效果如下图 python launch.py --share --xformers

 访问上面的public URL 

stable diffusion免费尝试网站

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

diffusionapicodepythonerpgstreamerwebwebuistable diffusiongitsharehuggingfacegradiourlelo浏览器hugging face服务器githubclone操作系统