Gourieff / comfyui-reactor-node

Fast and Simple Face Swap Extension Node for ComfyUI
GNU General Public License v3.0
1.63k stars 163 forks source link

cuda not found? #331

Open MrsHorrid opened 5 months ago

MrsHorrid commented 5 months ago

First, confirm

What happened?

wont let me run faceswap

Steps to reproduce the problem

Your workflow just regular old face swapping of 2 images

Sysinfo

windows 11 , python 11 , comfyui windows portable , only reactor

Relevant console log

RuntimeError: D:\a\_work\1\s\onnxruntime\python\onnxruntime_pybind_state.cc:857 onnxruntime::python::CreateExecutionProviderInstance CUDA_PATH is set but CUDA wasnt able to be loaded. Please install the correct version of CUDA andcuDNN as mentioned in the GPU requirements page  (https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html#requirements),  make sure they're in the PATH, and that your GPU is supported.

Additional information

yeah idk

WhiteCrowLX commented 5 months ago

I have the same problem

PresTrembleyIIIEsq commented 5 months ago

Just ran into the same thing in Linux (Manjaro) on a fresh install.

AntonYurievNikolov commented 5 months ago

Same here. Windows 11, using CUDA 12.2

ErvinA-wx commented 5 months ago

有谁解决这个问题了?可否告知方法?

lellotrek commented 5 months ago

Hi, same here. Windows 11, cuda_12.1.r12.1 everything updated to today

Eagle07-Sudo commented 5 months ago

Same thing here, anyone solve it?

lellotrek commented 5 months ago

it seems nothing new happen so now i have to switch on automatic1111 to check if is a node problem or the 12.1 cuda

lellotrek commented 5 months ago

Reactor on Forge working without problems so i try to manage the issue with onnxruntime and cuda 12 but without good result so i installed Comfyui but the manual one creating a venv to better manage all the libreries and now its working. Of course with the Insightface package issue but easly fixed as show on the documentation.

Gourieff commented 5 months ago

I've just tried to install everything from the scratch and ReActor works with no errors I installed the latest ComfyUI build https://github.com/comfyanonymous/ComfyUI/releases/download/latest/ComfyUI_windows_portable_nvidia_cu121_or_cpu.7z Then - ComfyUI Manager Then - Insightface https://github.com/Gourieff/comfyui-reactor-node#insightfacebuild And the last step - ReActor via ComfyUI Manager That's all

lellotrek commented 5 months ago

hello, i'm not sure if is this one the right way to reply but i follow your steps and i made a new comfyui installation but after a while i had the same issue so i made a new installation with a minimum of nodes to check and this is the result and my log, hope is the correct way to do it:

D:!00 AI\ComfyUI_windows_portable>.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build --disable-xformers --preview-method auto --enable-cors-header --disable-auto-launch --output-directory I:\09_Output\comfyui_saves [START] Security scan [DONE] Security scan

ComfyUI-Manager: installing dependencies done.

ComfyUI startup time: 2024-06-29 00:31:03.890992 Platform: Windows Python version: 3.11.8 (tags/v3.11.8:db85d51, Feb 6 2024, 22:03:32) [MSC v.1937 64 bit (AMD64)] Python executable: D:!00 AI\ComfyUI_windows_portable\python_embeded\python.exe ComfyUI Path: D:!00 AI\ComfyUI_windows_portable\ComfyUI\main.py Log path: D:!00 AI\ComfyUI_windows_portable\comfyui.log

Prestartup times for custom nodes: 1.2 seconds: D:!00 AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Manager

Total VRAM 8192 MB, total RAM 16236 MB pytorch version: 2.3.1+cu121 Set vram state to: NORMAL_VRAM Device: cuda:0 NVIDIA GeForce RTX 3070 Laptop GPU : cudaMallocAsync Using pytorch cross attention [Crystools INFO] Crystools version: 1.12.0 [Crystools INFO] CPU: AMD Ryzen 7 5800H with Radeon Graphics - Arch: AMD64 - OS: Windows 10 [Crystools INFO] GPU/s: [Crystools INFO] 0) NVIDIA GeForce RTX 3070 Laptop GPU [Crystools INFO] NVIDIA Driver: 555.99

Loading: ComfyUI-Impact-Pack (V5.18.4)

Loading: ComfyUI-Impact-Pack (Subpack: V0.6)

Loading: ComfyUI-Inspire-Pack (V0.80.4)

[Impact Pack] Wildcards loading done.

Loading: ComfyUI-Manager (V2.43)

ComfyUI Revision: 2265 [55f0dc12] | Released on '2024-06-18'

[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 [ReActor] - STATUS - Running v0.5.0-b4 in ComfyUI Torch version: 2.3.1+cu121

Import times for custom nodes: 0.0 seconds: D:!00 AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\websocket_image_save.py 0.0 seconds: D:!00 AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Crystools-save 0.1 seconds: D:!00 AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Inspire-Pack 0.4 seconds: D:!00 AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Manager 0.8 seconds: D:!00 AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Impact-Pack 1.4 seconds: D:!00 AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node 3.0 seconds: D:!00 AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Crystools

Setting output directory to: I:\09_Output\comfyui_saves Starting server

To see the GUI go to: http://127.0.0.1:8188 got prompt Failed to validate prompt for output 12:

EP Error EP Error D:\a_work\1\s\onnxruntime\python\onnxruntime_pybind_state.cc:891 onnxruntime::python::CreateExecutionProviderInstance CUDA_PATH is set but CUDA wasnt able to be loaded. Please install the correct version of CUDA andcuDNN as mentioned in the GPU requirements page (https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html#requirements), make sure they're in the PATH, and that your GPU is supported. when using ['CUDAExecutionProvider'] Falling back to ['CUDAExecutionProvider', 'CPUExecutionProvider'] and retrying.


2024-06-29 00:31:49.0726187 [E:onnxruntime:Default, provider_bridge_ort.cc:1745 onnxruntime::TryGetProviderInfo_CUDA] D:\a_work\1\s\onnxruntime\core\session\provider_bridge_ort.cc:1426 onnxruntime::ProviderLibrary::Get [ONNXRuntimeError] : 1 : FAIL : LoadLibrary failed with error 126 "" when trying to load "D:!00 AI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\onnxruntime\capi\onnxruntime_providers_cuda.dll"

!!! Exception during processing!!! D:\a_work\1\s\onnxruntime\python\onnxruntime_pybind_state.cc:891 onnxruntime::python::CreateExecutionProviderInstance CUDA_PATH is set but CUDA wasnt able to be loaded. Please install the correct versionof CUDA andcuDNN as mentioned in the GPU requirements page (https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html#requirements), make sure they're in the PATH, and that your GPU is supported.

Traceback (most recent call last): File "D:!00 AI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 419, in init self._create_inference_session(providers, provider_options, disabled_optimizers) File "D:!00 AI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 483, in _create_inference_session sess.initialize_session(providers, provider_options, disabled_optimizers) RuntimeError: D:\a_work\1\s\onnxruntime\python\onnxruntime_pybind_state.cc:891 onnxruntime::python::CreateExecutionProviderInstance CUDA_PATH is set but CUDA wasnt able to be loaded. Please install the correct version of CUDA andcuDNN as mentioned in the GPU requirements page (https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html#requirements), make sure they're in the PATH, and that your GPU is supported.

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "D:!00 AI\ComfyUI_windows_portable\ComfyUI\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:!00 AI\ComfyUI_windows_portable\ComfyUI\execution.py", line 81, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:!00 AI\ComfyUI_windows_portable\ComfyUI\execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:!00 AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\nodes.py", line 507, in blend_faces face = self.build_face_model(image) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:!00 AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\nodes.py", line 469, in build_face_model face_model = analyze_faces(image, det_size) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:!00 AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\scripts\reactor_swapper.py", line 147, in analyze_faces face_analyser = getAnalysisModel(det_size) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:!00 AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\scripts\reactor_swapper.py", line 77, in getAnalysisModel ANALYSIS_MODEL = insightface.app.FaceAnalysis( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:!00 AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\reactor_patcher.py", line 48, in patched_faceanalysis_init model = model_zoo.get_model(onnx_file, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:!00 AI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\insightface\model_zoo\model_zoo.py", line 96, in get_model model = router.get_model(providers=providers, provider_options=provider_options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:!00 AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\reactor_patcher.py", line 21, in patched_get_model session = PickableInferenceSession(self.onnx_file, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:!00 AI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\insightface\model_zoo\model_zoo.py", line 25, in init super().init(model_path, kwargs) File "D:!00 AI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 432, in init raise fallback_error from e File "D:!00 AI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 427, in init self._create_inference_session(self._fallback_providers, None) File "D:!00 AI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 483, in _create_inference_session sess.initialize_session(providers, provider_options, disabled_optimizers) RuntimeError: D:\a_work\1\s\onnxruntime\python\onnxruntime_pybind_state.cc:891 onnxruntime::python::CreateExecutionProviderInstance CUDA_PATH is set but CUDA wasnt able to be loaded. Please install the correct version of CUDA andcuDNN as mentioned in the GPU requirements page (https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html#requirements), make sure they're in the PATH, and that your GPU is supported.

Prompt executed in 15.21 seconds

lellotrek commented 5 months ago

I am sorry but just to be clear i uninstalled the cuda 12.1, installed the cuda 11.8, installed the old Comfyui 11.8, made update_comfyui_and_python_dependencies.bat, Insightface and ReaCtor has you suggested and now its working not with cuda 12. This is the log:

Total VRAM 8192 MB, total RAM 16236 MB pytorch version: 2.3.1+cu118 Set vram state to: NORMAL_VRAM Device: cuda:0 NVIDIA GeForce RTX 3070 Laptop GPU : cudaMallocAsync Using pytorch cross attention

Loading: ComfyUI-Impact-Pack (V5.18.4)

Loading: ComfyUI-Impact-Pack (Subpack: V0.6)

Loading: ComfyUI-Manager (V2.43)

[Impact Pack] Wildcards loading done.

ComfyUI Revision: 2306 [c39cf7ff] | Released on '2024-06-28'

[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 [ReActor] - STATUS - Running v0.5.0-b4 in ComfyUI Torch version: 2.3.1+cu118

Import times for custom nodes: 0.0 seconds: D:!00 AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\websocket_image_save.py 0.3 seconds: D:!00 AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Manager 1.1 seconds: D:!00 AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Impact-Pack 3.3 seconds: D:!00 AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node

Setting output directory to: I:\09_Output\comfyui_saves Starting server

To see the GUI go to: http://127.0.0.1:8188 FETCH DATA from: D:!00 AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Manager\extension-node-map.json [DONE] got prompt Failed to validate prompt for output 12:

SabrinaGalaLee commented 4 months ago

First, confirm

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

What happened?

wont let me run faceswap

Steps to reproduce the problem

Your workflow just regular old face swapping of 2 images

Sysinfo

windows 11 , python 11 , comfyui windows portable , only reactor

Relevant console log

RuntimeError: D:\a\_work\1\s\onnxruntime\python\onnxruntime_pybind_state.cc:857 onnxruntime::python::CreateExecutionProviderInstance CUDA_PATH is set but CUDA wasnt able to be loaded. Please install the correct version of CUDA andcuDNN as mentioned in the GPU requirements page  (https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html#requirements),  make sure they're in the PATH, and that your GPU is supported.

Additional information

yeah idk

my cuda version is 12.1 and cudnn is 8.9.2

also i got a same problem. but i solved this by

python_embeded\python.exe -m pip uninstall -y onnxruntime onnxruntime-gpu
python_embeded\python.exe -m pip install onnxruntime==1.15.1 

downgrading my onnxruntime version ** run python in python_embeded folder which is loacted in comfyui folder.

Amit30swgoh commented 4 months ago

First, confirm

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

What happened?

wont let me run faceswap

Steps to reproduce the problem

Your workflow just regular old face swapping of 2 images

Sysinfo

windows 11 , python 11 , comfyui windows portable , only reactor

Relevant console log

RuntimeError: D:\a\_work\1\s\onnxruntime\python\onnxruntime_pybind_state.cc:857 onnxruntime::python::CreateExecutionProviderInstance CUDA_PATH is set but CUDA wasnt able to be loaded. Please install the correct version of CUDA andcuDNN as mentioned in the GPU requirements page  (https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html#requirements),  make sure they're in the PATH, and that your GPU is supported.

Additional information

yeah idk

my cuda version is 12.1 and cudnn is 8.9.2

also i got a same problem. but i solved this by

python_embeded\python.exe -m pip uninstall -y onnxruntime onnxruntime-gpu
python_embeded\python.exe -m pip install onnxruntime==1.15.1 

downgrading my onnxruntime version ** run python in python_embeded folder which is loacted in comfyui folder.

so it doesnt utilize your VRAM only ram and its very slow right? how can you utilize vram gpu if you uninstalled "onnxruntime-gpu"

SabrinaGalaLee commented 4 months ago

First, confirm

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

What happened?

wont let me run faceswap

Steps to reproduce the problem

Your workflow just regular old face swapping of 2 images

Sysinfo

windows 11 , python 11 , comfyui windows portable , only reactor

Relevant console log

RuntimeError: D:\a\_work\1\s\onnxruntime\python\onnxruntime_pybind_state.cc:857 onnxruntime::python::CreateExecutionProviderInstance CUDA_PATH is set but CUDA wasnt able to be loaded. Please install the correct version of CUDA andcuDNN as mentioned in the GPU requirements page  (https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html#requirements),  make sure they're in the PATH, and that your GPU is supported.

Additional information

yeah idk

my cuda version is 12.1 and cudnn is 8.9.2 also i got a same problem. but i solved this by

python_embeded\python.exe -m pip uninstall -y onnxruntime onnxruntime-gpu
python_embeded\python.exe -m pip install onnxruntime==1.15.1 

downgrading my onnxruntime version ** run python in python_embeded folder which is loacted in comfyui folder.

so it doesnt utilize your VRAM only ram and its very slow right? how can you utilize vram gpu if you uninstalled "onnxruntime-gpu"

As you said, i uninstalled onnxruntime-gpu but i installed onnxruntime==1.15.1 (correct verrsion on my environment) after uninstalled. So onnxruntime-gpu is installed with onnxruntime==1.15.1 .

HiProAI commented 3 months ago

I am sorry but just to be clear i uninstalled the cuda 12.1, installed the cuda 11.8, installed the old Comfyui 11.8, made update_comfyui_and_python_dependencies.bat, Insightface and ReaCtor has you suggested and now its working not with cuda 12. This is the log:

Total VRAM 8192 MB, total RAM 16236 MB pytorch version: 2.3.1+cu118 Set vram state to: NORMAL_VRAM Device: cuda:0 NVIDIA GeForce RTX 3070 Laptop GPU : cudaMallocAsync Using pytorch cross attention

Loading: ComfyUI-Impact-Pack (V5.18.4)

Loading: ComfyUI-Impact-Pack (Subpack: V0.6)

Loading: ComfyUI-Manager (V2.43)

[Impact Pack] Wildcards loading done.

ComfyUI Revision: 2306 [c39cf7ff] | Released on '2024-06-28'

[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 [ReActor] - STATUS - Running v0.5.0-b4 in ComfyUI Torch version: 2.3.1+cu118

Import times for custom nodes: 0.0 seconds: D:!00 AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\websocket_image_save.py 0.3 seconds: D:!00 AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Manager 1.1 seconds: D:!00 AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Impact-Pack 3.3 seconds: D:!00 AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node

Setting output directory to: I:\09_Output\comfyui_saves Starting server

To see the GUI go to: http://127.0.0.1:8188 FETCH DATA from: D:!00 AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Manager\extension-node-map.json [DONE] got prompt Failed to validate prompt for output 12:

  • (prompt):

    • Required input is missing: images
  • PreviewImage 12:

    • Required input is missing: images Output will be ignored [ReActor] 01:28:12 - STATUS - Building Face Model 1 of 4... 25% [ReActor] 01:28:21 - STATUS - Building Face Model 2 of 4... 50% [ReActor] 01:28:21 - STATUS - Building Face Model 3 of 4... 75% [ReActor] 01:28:22 - STATUS - Building Face Model 4 of 4... [ReActor] 01:28:22 - STATUS - Trying to halve 'det_size' parameter ........................................................... 100% [ReActor] 01:28:28 - STATUS - Blending with Compute Method 'Mean'... Face model has been saved to 'D:!00 AI\ComfyUI_windows_portable\ComfyUI\models\reactor\faces\default.safetensors' [ReActor] 01:28:28 - STATUS - --Done!-- Prompt executed in 32.41 seconds

I am trying the same with no success for days and then saw that someone else said to downgrade the onnxruntime I did so after uninstall CUDA 12 and resort back to Cuda 11.8 then downgrade to onnxruntime to 1.17.1 and Voila Success. python_embeded\python.exe -m pip uninstall -y onnxruntime onnxruntime-gpu python_embeded\python.exe -m pip install onnxruntime==1.17.1

Gourieff commented 2 months ago

If you guys have NVIDIA GPUs you should install "onnxruntime-gpu" but not "onnxruntime" when downgrading or reinstalling ORT