Installation and Use Error
Attempting to pip install insightface gets me this error message
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. numba 0.60.0 requires numpy<2.1,>=1.22, but you have numpy 2.1.3 which is incompatible.
Successfully installed Pillow-11.0.0 PyYAML-6.0.2 albucore-0.0.20 albumentations-1.4.21 annotated-types-0.7.0 certifi-2024.8.30 charset-normalizer-3.4.0 colorama-0.4.6 contourpy-1.3.1 cycler-0.12.1 cython-3.0.11 easydict-1.13 eval-type-backport-0.2.0 fonttools-4.54.1 idna-3.10 imageio-2.36.0 insightface-0.7.3 joblib-1.4.2 kiwisolver-1.4.7 lazy-loader-0.4 matplotlib-3.9.2 networkx-3.4.2 numpy-2.1.3 onnx-1.17.0 opencv-python-headless-4.10.0.84 packaging-24.2 prettytable-3.12.0 protobuf-5.28.3 pydantic-2.9.2 pydantic-core-2.23.4 pyparsing-3.2.0 python-dateutil-2.9.0.post0 requests-2.32.3 scikit-image-0.24.0 scikit-learn-1.5.2 scipy-1.14.1 simsimd-6.0.5 six-1.16.0 stringzilla-3.10.10 threadpoolctl-3.5.0 tifffile-2024.9.20 tqdm-4.67.0 typing-extensions-4.12.2 urllib3-2.2.3 wcwidth-0.2.13
numpy is forcefully installed to version 2.1.3, which it then complains about saying it needs 1.22
Any time I try to run InsightFace using ComfyUI, I get this error message.
!!! Exception during processing !!! numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject
Traceback (most recent call last):
File "E:\AIArt\ComfyUI_windows_portable\ComfyUI\execution.py", line 323, in execute
output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\AIArt\ComfyUI_windows_portable\ComfyUI\execution.py", line 198, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\AIArt\ComfyUI_windows_portable\ComfyUI\execution.py", line 169, in map_node_over_list
process_inputs(input_dict, i)
File "E:\AIArt\ComfyUI_windows_portable\ComfyUI\execution.py", line 158, in process_inputs
results.append(getattr(obj, func)(**inputs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\AIArt\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_IPAdapter_plus\IPAdapterPlus.py", line 674, in load_insightface
return (insightface_loader(provider, model_name=model_name),)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\AIArt\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_IPAdapter_plus\utils.py", line 159, in insightface_loader
from insightface.app import FaceAnalysis
File "E:\AIArt\ComfyUI_windows_portable\python_embeded\Lib\site-packages\insightface_init.py", line 18, in
I have the same problem, my error is 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
As of 11/19/2024, the problem still persists. Tried the installation with Python version 3.11 and 3.12
I try uninstall opnecv-python-headless and install opencv-python was successful
I try uninstall opnecv-python-headless and install opencv-python was successful
Unrelated
You should install it from git, try this:
pip install -e "git+https://github.com/deepinsight/insightface.git#egg=insightface&subdirectory=python-package"
You should install it from git, try this:
pip install -e "git+https://github.com/deepinsight/insightface.git#egg=insightface&subdirectory=python-package"
Building wheels for collected packages: insightface
Building editable for insightface (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building editable for insightface (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [19 lines of output]
WARNING: pandoc not enabled
INFO: running editable_wheel
INFO: creating C:\Users\CyberSys\AppData\Local\Temp\pip-wheel-pfj3rq7j.tmp-460x6jsp\insightface.egg-info
INFO: writing C:\Users\CyberSys\AppData\Local\Temp\pip-wheel-pfj3rq7j.tmp-460x6jsp\insightface.egg-info\PKG-INFO
INFO: writing dependency_links to C:\Users\CyberSys\AppData\Local\Temp\pip-wheel-pfj3rq7j.tmp-460x6jsp\insightface.egg-info\dependency_links.txt
INFO: writing entry points to C:\Users\CyberSys\AppData\Local\Temp\pip-wheel-pfj3rq7j.tmp-460x6jsp\insightface.egg-info\entry_points.txt
INFO: writing requirements to C:\Users\CyberSys\AppData\Local\Temp\pip-wheel-pfj3rq7j.tmp-460x6jsp\insightface.egg-info\requires.txt
INFO: writing top-level names to C:\Users\CyberSys\AppData\Local\Temp\pip-wheel-pfj3rq7j.tmp-460x6jsp\insightface.egg-info\top_level.txt
INFO: writing manifest file 'C:\Users\CyberSys\AppData\Local\Temp\pip-wheel-pfj3rq7j.tmp-460x6jsp\insightface.egg-info\SOURCES.txt'
INFO: reading manifest file 'C:\Users\CyberSys\AppData\Local\Temp\pip-wheel-pfj3rq7j.tmp-460x6jsp\insightface.egg-info\SOURCES.txt'
INFO: writing manifest file 'C:\Users\CyberSys\AppData\Local\Temp\pip-wheel-pfj3rq7j.tmp-460x6jsp\insightface.egg-info\SOURCES.txt'
INFO: creating 'C:\Users\CyberSys\AppData\Local\Temp\pip-wheel-pfj3rq7j.tmp-460x6jsp\insightface-0.7.3.dist-info'
E:\ComfyUI-StableDif-t27-p312-cu128\python_embeded\Lib\site-packages\setuptools\command\bdist_wheel.py:103: RuntimeWarning: Config variable 'Py_DEB
UG' is unset, Python ABI tag may be incorrect
if get_flag("Py_DEBUG", hasattr(sys, "gettotalrefcount"), warn=(impl == "cp")):
INFO: creating C:\Users\CyberSys\AppData\Local\Temp\pip-wheel-pfj3rq7j.tmp-460x6jsp\insightface-0.7.3.dist-info\WHEEL
INFO: running build_py
INFO: running build_ext
INFO: building 'insightface.thirdparty.face3d.mesh.cython.mesh_core_cython' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-bui
ld-tools/
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building editable for insightface