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

Precompiled insightface wheel not compatible with Portable ComfyUI v0.2.4 #471

Open
3 tasks done
Quaggles opened this issue Oct 26, 2024 · 5 comments
Open
3 tasks done
Labels
bug Something isn't working 📝 documentation Improvements or additions to documentation

Comments

@Quaggles
Copy link

Quaggles commented Oct 26, 2024

First, confirm

  • I have read the instruction carefully
  • I have searched the existing issues
  • I have updated the extension to the latest version

What happened?

The new ComfyUI v0.2.4 portable release uses Python 3.12, CUDA 12.4, pytorch 2.5 and numpy v2.1.2. When I install the Python 3.12 wheel of insightface (https://github.com/Gourieff/Assets/raw/main/Insightface/insightface-0.7.3-cp312-cp312-win_amd64.whl) I get the error:
Cannot import C:\comfy\ComfyUI\custom_nodes\comfyui-reactor-node module for custom nodes: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

If I install cython and manually copy over the include and libs folders from C:\Users\<User>\AppData\Local\Programs\Python\Python312 to comfy\python_embeded and run a regular pip install insightface it compiles and works but for many end users compiling it themselves will be too complicated.

Is the error occuring because the wheel was compiled with numpy 1.x.x? If so since the official ComfyUI release has moved to numpy v2 would you be able to provide a compatible wheel for that version?

Steps to reproduce the problem

  1. Download and extract the ComfyUI v0.2.4 release, https://github.com/comfyanonymous/ComfyUI/releases/tag/v0.2.4
  2. Install the precompiled insightface wheel with .\python_embeded\python.exe -m pip install https://github.com/Gourieff/Assets/raw/main/Insightface/insightface-0.7.3-cp312-cp312-win_amd64.whl
  3. Clone ReActor into ComfyUI\custom_nodes
  4. Run comfyui-reactor-node\install.bat
  5. Run ComfyUI and see error

Sysinfo

Windows 11
Chrome
RTX 2080ti
No other custom nodes installed

Relevant console log

C:\comfy>.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build
Total VRAM 11264 MB, total RAM 32683 MB
pytorch version: 2.5.0+cu124
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 2080 Ti : cudaMallocAsync
Using pytorch cross attention
[Prompt Server] web root: C:\comfy\ComfyUI\web
C:\comfy\python_embeded\Lib\site-packages\kornia\feature\lightglue.py:44: FutureWarning: `torch.cuda.amp.custom_fwd(args...)` is deprecated. Please use `torch.amp.custom_fwd(args..., device_type='cuda')` instead.
  @torch.cuda.amp.custom_fwd(cast_inputs=torch.float32)
Traceback (most recent call last):
  File "C:\comfy\ComfyUI\nodes.py", line 2001, in load_custom_node
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "C:\comfy\ComfyUI\custom_nodes\comfyui-reactor-node\__init__.py", line 23, in <module>
    from .nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
  File "C:\comfy\ComfyUI\custom_nodes\comfyui-reactor-node\nodes.py", line 15, in <module>
    from insightface.app.common import Face
  File "C:\comfy\python_embeded\Lib\site-packages\insightface\__init__.py", line 18, in <module>
    from . import app
  File "C:\comfy\python_embeded\Lib\site-packages\insightface\app\__init__.py", line 2, in <module>
    from .mask_renderer import *
  File "C:\comfy\python_embeded\Lib\site-packages\insightface\app\mask_renderer.py", line 8, in <module>
    from ..thirdparty import face3d
  File "C:\comfy\python_embeded\Lib\site-packages\insightface\thirdparty\face3d\__init__.py", line 3, in <module>
    from . import mesh
  File "C:\comfy\python_embeded\Lib\site-packages\insightface\thirdparty\face3d\mesh\__init__.py", line 9, in <module>
    from .cython import mesh_core_cython
  File "insightface\\thirdparty\\face3d\\mesh\\cython\\mesh_core_cython.pyx", line 1, in init insightface.thirdparty.face3d.mesh.cython.mesh_core_cython
ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

Cannot import C:\comfy\ComfyUI\custom_nodes\comfyui-reactor-node module for custom nodes: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

Import times for custom nodes:
   0.0 seconds: C:\comfy\ComfyUI\custom_nodes\websocket_image_save.py
   0.6 seconds (IMPORT FAILED): C:\comfy\ComfyUI\custom_nodes\comfyui-reactor-node

Starting server

To see the GUI go to: http://127.0.0.1:8188

Additional information

No response

@Quaggles Quaggles added bug Something isn't working new labels Oct 26, 2024
@Raees760
Copy link

Having same issue and idk how to fix it

@embeddedDevices
Copy link

Hello,
having same issue, perfect describtion of the problem.

@patrice74
Copy link

Good morning,
To work around the problem:
In your "ComfyUI_windows_portable\python_embeded" directory, run the command: python.exe -m pip install numpy==1.26.4
It works for me.

@embeddedDevices
Copy link

embeddedDevices commented Oct 28, 2024

Good morning, To work around the problem: In your "ComfyUI_windows_portable\python_embeded" directory, run the command: python.exe -m pip install numpy==1.26.4 It works for me.

Thank you so much. That works fine.

@Gourieff Gourieff added 📝 documentation Improvements or additions to documentation and removed new labels Oct 29, 2024
@YurchenkoAndrew
Copy link

Раньше с бубнами, но получалось поставить. Сейчас ComfyUI переустановил и все. Уже и по инструкции основной попробовал и в ручном варианте, и "ComfyUI_windows_portable\python_embeded" directory, run the command: python.exe -m pip install numpy==1.26.4 It works for me это испробовал. Ошибка такая как в заголовки и хоть ты тресни.

`Prestartup times for custom nodes:
5.8 seconds: C:\AI\ComfyUI\ComfyUI\custom_nodes\ComfyUI-Manager

Total VRAM 6144 MB, total RAM 16236 MB
pytorch version: 2.5.1+cu124
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 3060 Laptop GPU : cudaMallocAsync
Using pytorch cross attention
[Prompt Server] web root: C:\AI\ComfyUI\ComfyUI\web

Loading: ComfyUI-Manager (V2.51.9)

ComfyUI Revision: 2841 [89861512] | Released on '2024-11-19'

[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/alter-list.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/model-list.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/github-stats.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/extension-node-map.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json
Traceback (most recent call last):
File "C:\AI\ComfyUI\ComfyUI\nodes.py", line 2024, in load_custom_node
module_spec.loader.exec_module(module)
File "", line 995, in exec_module
File "", line 488, in call_with_frames_removed
File "C:\AI\ComfyUI\ComfyUI\custom_nodes\comfyui-reactor-node_init
.py", line 23, in
from .nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
File "C:\AI\ComfyUI\ComfyUI\custom_nodes\comfyui-reactor-node\nodes.py", line 15, in
from insightface.app.common import Face
File "C:\AI\ComfyUI\python_embeded\Lib\site-packages\insightface_init_.py", line 18, in
from . import app
File "C:\AI\ComfyUI\python_embeded\Lib\site-packages\insightface\app_init_.py", line 2, in
from .mask_renderer import *
File "C:\AI\ComfyUI\python_embeded\Lib\site-packages\insightface\app\mask_renderer.py", line 8, in
from ..thirdparty import face3d
File "C:\AI\ComfyUI\python_embeded\Lib\site-packages\insightface\thirdparty\face3d_init_.py", line 3, in
from . import mesh
File "C:\AI\ComfyUI\python_embeded\Lib\site-packages\insightface\thirdparty\face3d\mesh_init_.py", line 9, in
from .cython import mesh_core_cython
File "insightface\thirdparty\face3d\mesh\cython\mesh_core_cython.pyx", line 1, in init insightface.thirdparty.face3d.mesh.cython.mesh_core_cython
ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

Cannot import C:\AI\ComfyUI\ComfyUI\custom_nodes\comfyui-reactor-node module for custom nodes: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

Import times for custom nodes:
0.0 seconds: C:\AI\ComfyUI\ComfyUI\custom_nodes\websocket_image_save.py
0.0 seconds: C:\AI\ComfyUI\ComfyUI\custom_nodes\cg-use-everywhere
0.0 seconds: C:\AI\ComfyUI\ComfyUI\custom_nodes\ComfyUI_UltimateSDUpscale
0.3 seconds: C:\AI\ComfyUI\ComfyUI\custom_nodes\ComfyUI-Manager
0.8 seconds (IMPORT FAILED): C:\AI\ComfyUI\ComfyUI\custom_nodes\comfyui-reactor-node

Starting server

To see the GUI go to: http://127.0.0.1:8188`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 📝 documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

6 participants