Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

我有一个问题需要帮助 #51

Open
wibur0620 opened this issue Mar 25, 2024 · 7 comments
Open

我有一个问题需要帮助 #51

wibur0620 opened this issue Mar 25, 2024 · 7 comments

Comments

@wibur0620
Copy link

您的项目中需要mediapipe这个库。目前这个库最高的版本是0.10.11,然后和它兼容的 protobuf库的版本最高只能到3.20.3,正是因为这个protobuf的版本3.20.3太旧了,导致凡是使用InsightFace框架的程序在加载InsightFace库的时候变得极度缓慢,比如ip适配器。InstantID。ReActor等插件需要使用InsightFace框架对人脸进行检测的时候,就会因为 protobuf-3.20.3过旧的版本导致非常的缓慢,比新版本的 protobuf要慢几十倍的速度。
请问这个mediapipe库是否可以取消,因为目前我发现极少插件在使用这个库。目前我安装的五十多插件中只有你的插件在使用这个库,如果可以取消掉这个库,就完美了

@wibur0620
Copy link
Author

当然我可以强制升级 protobuf,无视mediapipe库的错误报告,只是目前我不知道您插件中那个节点在使用mediapipe库。而且您这边项目库不删除mediapipe依赖要求。下次更新您的插件。同样会自动将 protobuf-3.20.3降级到3.20.3版本。

@wibur0620
Copy link
Author

我观察到你的依赖要求文档中包含了mediapipe和google-generativeai,如果没有mediapipe依赖的话,那么安装google-generativeai会自动安装protobuf,并且protobuf的版本不会很旧,但是因为存在mediapipe库,会导致自动安装的protobuf很陈旧,结果就导致我上面所讲的,所有使用InsightFace框架的插件。将会变的极慢,
我目前的解决办法是安装好你的以来要求文档中的依赖后。在卸载google-generativeai和它包含的几个google的库,卸载protobuf。
然后在安装google-generativeai
这将会自动将google-generativeai和它包含的几个库一起安装,同时安装自动protobuf。并且版本很新。
只是会有一个报错,提示protobuf的版本超过了mediapipe要求的版本,这里我无视掉这个错误,
作者看到后请告诉我您的插件是那个节点在使用mediapipe库,我看看能不能正常使用那个节点。

@chflame163
Copy link
Owner

作者看到后请告诉我您的插件是那个节点在使用mediapipe库,我看看能不能正常使用那个节点。

感谢反馈。我之前也遇到了insightface加载缓慢的问题,一直没找到原因。

使用mediapipe的节点是LayerMask: PersonMaskUltra和LayerMask: PersonMaskUltra V2。我按照你的方法直接用pip install protobuf==5.26.0命令升级protobuf到最新版,这两个节点可以正常使用并且insightface加载速度也恢复正常。

所以当升级插件后,需要手动执行一次这个命令更新protobuf。我准备做一个依赖包版本管理脚本,连同opencv-contrib-python问题一起解决。

@chflame163
Copy link
Owner

chflame163 commented Mar 26, 2024

现在可以双击运行插件目录下的repair_dependency.bat自动修复3个依赖包的问题。如果在国外请修改bat文件中倒数第三行, 删除-i https://pypi.tuna.tsinghua.edu.cn/simple

@wibur0620
Copy link
Author

现在可以双击运行插件目录下的repair_dependency.bat自动修复3个依赖包的问题。如果在国外请修改bat文件中倒数第三行, 删除-i https://pypi.tuna.tsinghua.edu.cn/simple

升级protobuf版本,最好将protobuf和googleapis-common-protos google-generativeai google-auth google-api-core google-ai-generativelanguage,一起卸载了。然后安装的时候对于google的几个库和protobuf,只需要安装google-generativeai,就会全部自动安装上,而且protobuf和google的几个库会非常兼容并且是最新的。单独升级protobuf。google有几个库会报错。不知道会不会产生影响。我觉得按照我给的顺序去升级protobuf版本应该是最稳妥的

@wpwant
Copy link

wpwant commented Jun 15, 2024

大佬,我也遇到问题了,“Cannot import F:\ComfyUI\custom_nodes\ComfyUI_LayerStyle module for custom nodes: cannot import name 'builder' from 'google.protobuf.internal' (F:\ComfyUI\Python310\lib\site-packages\google\protobuf\internal_init_.py)”,我网上查的也说是运行依赖出问题了,但是我运行了“repair_dependency.bat”这个文件,说是系统找不到指定的路径,是什么原因?搞一天了没搞定,快崩溃了都

@wpwant
Copy link

wpwant commented Jun 15, 2024

大佬,你是怎么解决的?求拯救,程序小白,完全不懂,搞了一天了没搞定,求搭救

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants