cubiq / ComfyUI_InstantID

Apache License 2.0
1.3k stars 72 forks source link

Import Failed for InstantID #188

Open deastman2 opened 4 months ago

deastman2 commented 4 months ago

I'm getting an Import Failed for InstantID with my ComfyUI portable installation on Windows 10. I've read through all the countless discussions about this problem and tried all of the supposed solutions, none of which have actually solved the problem for me. Honestly all these answers sound a bit like superstition, suggesting to reinstall components manually in hopes that they will somehow fix the problem without ever truly understanding what the root cause actually is. Well, I've looked at the console output, and as far as I can tell, InstantID won't import because InsightFace depends on the Onnxruntime, and that's the component which is actually failing. I haven't been able to figure out how to fix it, but here are the relevant traceback lines:

Traceback (most recent call last): File "D:\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\python_embeded\Lib\site-packages\insightface__init.py", line 8, in import onnxruntime File "D:\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\python_embeded\Lib\site-packages\onnxruntime__init__.py", line 57, in raise import_capi_exception File "D:\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\python_embeded\Lib\site-packages\onnxruntime\init__.py", line 23, in from onnxruntime.capi._pybind_state import ExecutionMode # noqa: F401 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\python_embeded\Lib\site-packages\onnxruntime\capi_pybind_state.py", line 32, in from .onnxruntime_pybind11_state import * # noqa ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ImportError: DLL load failed while importing onnxruntime_pybind11_state: A dynamic link library (DLL) initialization routine failed.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "D:\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\nodes.py", line 1907, in load_custom_node module_spec.loader.exec_module(module) File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "D:\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_InstantID__init.py", line 1, in from .InstantID import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS File "D:\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_InstantID\InstantID.py", line 13, in from insightface.app import FaceAnalysis File "D:\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\python_embeded\Lib\site-packages\insightface\init__.py", line 10, in raise ImportError( ImportError: Unable to import dependency onnxruntime.

Cannot import D:\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_InstantID module for custom nodes: Unable to import dependency onnxruntime.