stable diffusion 安装xFormers 报错:Couldn‘t install open_clip.

[复制链接]
查看1060 | 回复0 | 2023-8-16 13:46:37 | 显示全部楼层 |阅读模式
 一、No module ‘xformers’. Proceeding without it.

这是因为没有安装xformers导致的。
解决办法:
在webui-user.bat文件这添加一行:
  1. set COMMANDLINE_ARGS=--xformers
复制代码
如下图所示:

试着点击webui-user.bat,看能否下载,如果等了很久报错了,是网络问题,需要科学,但是科学你开全局也没有用
解决方法:我使用的是有蓝色的猫的软件。步骤如下:
(1)打开webui中的launch.py文件,找到prepare_enviroment()函数部分,在下图画圈部分的网址https://github.com前面添加https://ghproxy.com/,然后保存文件。

然后试着点击webui-user.bat,看能否下载,如果不能,继续执行(2)和(3)。(我是不行的)
(2)开启服务模式,若开启服务模式报错,请参考第五节
(3)然后开启TUN模式

 然后再次点击webui-user.bat,运行一段时间,就能够成功安装这些包了,如下图所示:


二、Couldn’t install requirements for Web UI
翻看报错日志发现是出现如下错误:


  1. No matching distribution found for gradio==3.23
复制代码
然后发现它使用的是国内的源,所以这个错误的原因就是当前的源找不到这个版本的包。
解决办法: 换其他的源
在launch.py文件中找到run_pip函数,在命令后添加:
  1. --trusted-host 信任的主机地址 -i 源地址
复制代码
如下图:

常见的源:
阿里云 http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣(douban) http://pypi.douban.com/simple/
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/


三、v1-5-pruned-emaonly.safetensors没有下载完全就出错


解决办法:从huggingface.co/CompVis/stable-diffusion-v-1-4-original/tree/main这个网站下载Stable Diffusion的权重文件,然后放在models/Stable Diffusion,权重文件如下:
 
 
四、GPU显存问题

电脑显存只有3G,第一次跑的时候出现了如下错误:
  1. OutOfMemoryException
复制代码
解决办法:在webui-user.bat文件中添加–lowvram这个语句,即:
  1. set COMMANDLINE_ARGS=--xformers
  2. --lowvram
复制代码
如下图:
 
它适用于显存不到2G的。
五、服务模式 无法安装

Windows
先确定系统安装了.NET framework runtime
然后尝试手动安装:

  • 打开 C:/Program Files 目录,新建 Clash for Windows Service 目录
  • 进入 安装目录/resources/static/files/win/[x64|arm64|ia32]/service 目录,拷贝里面两个 exe 文件到 1 中新建目录中
  • 进入 安装目录/resources/static/files/win/common 目录,拷贝 service.yml 文件到 1 中新建目录中
  • 在 1 中新建目录中,使用管理员权限打开 CMD 执行一下命令:
    1. service.exe install
    2. service.exe start
    复制代码
如果 install 时出现如下提示:
  1. Service with id 'Clash Core Service' already exists
  2. To install the service, delete the existing one or change service Id in the configuration file
  3. 2022-09-26 09:37:32,316 FATAL - Unhandled exception
  4. System.Exception: Installation failure: Service with id 'Clash Core Service' already exists
  5.    at WinSW.Program.<Run>g__Install|2_0(<>c__DisplayClass2_0& )
  6.    at WinSW.Program.Run(String[] argsArray, IWinSWConfiguration descriptor)
  7.    at WinSW.Program.Main(String[] args)
  8. System.Exception: Installation failure: Service with id 'Clash Core Service' already exists
  9.    at WinSW.Program.<Run>g__Install|2_0(<>c__DisplayClass2_0& )
  10.    at WinSW.Program.Run(String[] argsArray, IWinSWConfiguration descriptor)
  11.    at WinSW.Program.Main(String[] args)
复制代码
可以先执行:
  1. service.exe stop
  2. service.exe uninstall
复制代码
如果安装后,Service Mode manage 里显示 active 但图标显示红色,可以进入 Home Directory 管理员启动 CMD,执行 icacls.exe service /remove:d Everyone 后手动删除 service 文件夹,重启 APP 即可

macOS

  • 打开终端
  • 运行以下命令:
    1. curl https://gist.githubusercontent.com/Fndroid/2119fcb5ccb5a543a8f6a609418ae43f/raw/ff63615309a9b3f3e1d682fc29bc73284816422e/mac.sh > cfw-tun.sh && chmod +x cfw-tun.sh && sudo ./cfw-tun.sh install && rm cfw-tun.sh
    复制代码
    如要卸载则将 install 改为 uninstall

 

来源:https://blog.csdn.net/weixin_42045719/article/details/130071986
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则