comfyanonymous / ComfyUI

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface.
https://www.comfy.org/
GNU General Public License v3.0
58.64k stars 6.22k forks source link

CUDA error cudaErrorNoKernelImageForDevice:no kernel image is available for execution on the device #5616

Closed FORSAKENYOR closed 2 weeks ago

FORSAKENYOR commented 2 weeks ago

Expected Behavior

to not run into any error

Actual Behavior

Untitled

Steps to Reproduce

installed comfyui them the custom node manager via git clone then the reactor node but i have an issue which was resolved wheni installed numpy 1.26.4, then i installed cuda 12.4, tehn i run the bat file and the node is imported succesfully, face restore works but while running face swap i run into this error.

Debug Logs

# ComfyUI Error Report
## Error Details
- **Node Type:** ReActorFaceSwapOpt
- **Exception Type:** onnxruntime.capi.onnxruntime_pybind11_state.Fail
- **Exception Message:** [ONNXRuntimeError] : 1 : FAIL : Non-zero status code returned while running Relu node. Name:'Relu_2' Status Message: CUDA error cudaErrorNoKernelImageForDevice:no kernel image is available for execution on the device
## Stack Trace

  File "D:\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 "D:\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 "D:\ComfyUI_windows_portable\ComfyUI\execution.py", line 169, in _map_node_over_list
    process_inputs(input_dict, i)

  File "D:\ComfyUI_windows_portable\ComfyUI\execution.py", line 158, in process_inputs
    results.append(getattr(obj, func)(**inputs))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\nodes.py", line 441, in execute
    result = reactor.execute(
             ^^^^^^^^^^^^^^^^

  File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\nodes.py", line 350, in execute
    script.process(

  File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\scripts\reactor_faceswap.py", line 101, in process
    result = swap_face(
             ^^^^^^^^^^

  File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\scripts\reactor_swapper.py", line 246, in swap_face
    source_faces = analyze_faces(source_img)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^

  File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\scripts\reactor_swapper.py", line 152, in analyze_faces
    faces = face_analyser.get(img_data)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "D:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\insightface\app\face_analysis.py", line 59, in get
    bboxes, kpss = self.det_model.detect(img,
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "D:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\insightface\model_zoo\retinaface.py", line 224, in detect
    scores_list, bboxes_list, kpss_list = self.forward(det_img, self.det_thresh)
                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "D:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\insightface\model_zoo\retinaface.py", line 152, in forward
    net_outs = self.session.run(self.output_names, {self.input_name : blob})
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "D:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 266, in run
    return self._sess.run(output_names, input_feed, run_options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

System Information

Logs

2024-11-14 21:12:54,189 - root - INFO - Total VRAM 4096 MB, total RAM 16280 MB
2024-11-14 21:12:54,189 - root - INFO - pytorch version: 2.5.1+cu124
2024-11-14 21:12:54,192 - root - INFO - Set vram state to: NORMAL_VRAM
2024-11-14 21:12:54,193 - root - INFO - Device: cuda:0 NVIDIA GeForce GTX 950M : native
2024-11-14 21:13:01,788 - root - INFO - Using pytorch cross attention
2024-11-14 21:13:10,626 - root - INFO - [Prompt Server] web root: D:\ComfyUI_windows_portable\ComfyUI\web
2024-11-14 21:13:19,875 - root - INFO - 
Import times for custom nodes:
2024-11-14 21:13:19,876 - root - INFO -    0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\websocket_image_save.py
2024-11-14 21:13:19,877 - root - INFO -    0.5 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Manager
2024-11-14 21:13:19,878 - root - INFO -    4.7 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node
2024-11-14 21:13:19,879 - root - INFO - 
2024-11-14 21:13:19,888 - root - INFO - Starting server

2024-11-14 21:13:19,889 - root - INFO - To see the GUI go to: http://127.0.0.1:8188
2024-11-14 21:13:24,934 - root - INFO - got prompt
2024-11-14 21:13:30,563 - root - ERROR - !!! Exception during processing !!! [ONNXRuntimeError] : 1 : FAIL : Non-zero status code returned while running Relu node. Name:'Relu_2' Status Message: CUDA error cudaErrorNoKernelImageForDevice:no kernel image is available for execution on the device
2024-11-14 21:13:30,712 - root - ERROR - Traceback (most recent call last):
  File "D:\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 "D:\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 "D:\ComfyUI_windows_portable\ComfyUI\execution.py", line 169, in _map_node_over_list
    process_inputs(input_dict, i)
  File "D:\ComfyUI_windows_portable\ComfyUI\execution.py", line 158, in process_inputs
    results.append(getattr(obj, func)(**inputs))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\nodes.py", line 441, in execute
    result = reactor.execute(
             ^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\nodes.py", line 350, in execute
    script.process(
  File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\scripts\reactor_faceswap.py", line 101, in process
    result = swap_face(
             ^^^^^^^^^^
  File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\scripts\reactor_swapper.py", line 246, in swap_face
    source_faces = analyze_faces(source_img)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\scripts\reactor_swapper.py", line 152, in analyze_faces
    faces = face_analyser.get(img_data)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\insightface\app\face_analysis.py", line 59, in get
    bboxes, kpss = self.det_model.detect(img,
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\insightface\model_zoo\retinaface.py", line 224, in detect
    scores_list, bboxes_list, kpss_list = self.forward(det_img, self.det_thresh)
                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\insightface\model_zoo\retinaface.py", line 152, in forward
    net_outs = self.session.run(self.output_names, {self.input_name : blob})
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 266, in run
    return self._sess.run(output_names, input_feed, run_options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
onnxruntime.capi.onnxruntime_pybind11_state.Fail: [ONNXRuntimeError] : 1 : FAIL : Non-zero status code returned while running Relu node. Name:'Relu_2' Status Message: CUDA error cudaErrorNoKernelImageForDevice:no kernel image is available for execution on the device

2024-11-14 21:13:30,715 - root - INFO - Prompt executed in 5.77 seconds
2024-11-14 21:21:07,568 - root - INFO - got prompt
2024-11-14 21:21:07,639 - root - ERROR - !!! Exception during processing !!! [ONNXRuntimeError] : 1 : FAIL : Non-zero status code returned while running Relu node. Name:'Relu_2' Status Message: CUDA error cudaErrorNoKernelImageForDevice:no kernel image is available for execution on the device
2024-11-14 21:21:07,641 - root - ERROR - Traceback (most recent call last):
  File "D:\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 "D:\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 "D:\ComfyUI_windows_portable\ComfyUI\execution.py", line 169, in _map_node_over_list
    process_inputs(input_dict, i)
  File "D:\ComfyUI_windows_portable\ComfyUI\execution.py", line 158, in process_inputs
    results.append(getattr(obj, func)(**inputs))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\nodes.py", line 441, in execute
    result = reactor.execute(
             ^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\nodes.py", line 350, in execute
    script.process(
  File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\scripts\reactor_faceswap.py", line 101, in process
    result = swap_face(
             ^^^^^^^^^^
  File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\scripts\reactor_swapper.py", line 246, in swap_face
    source_faces = analyze_faces(source_img)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\scripts\reactor_swapper.py", line 152, in analyze_faces
    faces = face_analyser.get(img_data)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\insightface\app\face_analysis.py", line 59, in get
    bboxes, kpss = self.det_model.detect(img,
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\insightface\model_zoo\retinaface.py", line 224, in detect
    scores_list, bboxes_list, kpss_list = self.forward(det_img, self.det_thresh)
                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\insightface\model_zoo\retinaface.py", line 152, in forward
    net_outs = self.session.run(self.output_names, {self.input_name : blob})
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 266, in run
    return self._sess.run(output_names, input_feed, run_options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
onnxruntime.capi.onnxruntime_pybind11_state.Fail: [ONNXRuntimeError] : 1 : FAIL : Non-zero status code returned while running Relu node. Name:'Relu_2' Status Message: CUDA error cudaErrorNoKernelImageForDevice:no kernel image is available for execution on the device

2024-11-14 21:21:07,644 - root - INFO - Prompt executed in 0.07 seconds
2024-11-14 21:21:16,995 - root - INFO - got prompt
2024-11-14 21:21:17,089 - root - ERROR - !!! Exception during processing !!! [ONNXRuntimeError] : 1 : FAIL : Non-zero status code returned while running Relu node. Name:'Relu_2' Status Message: CUDA error cudaErrorNoKernelImageForDevice:no kernel image is available for execution on the device
2024-11-14 21:21:17,090 - root - ERROR - Traceback (most recent call last):
  File "D:\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 "D:\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 "D:\ComfyUI_windows_portable\ComfyUI\execution.py", line 169, in _map_node_over_list
    process_inputs(input_dict, i)
  File "D:\ComfyUI_windows_portable\ComfyUI\execution.py", line 158, in process_inputs
    results.append(getattr(obj, func)(**inputs))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\nodes.py", line 441, in execute
    result = reactor.execute(
             ^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\nodes.py", line 350, in execute
    script.process(
  File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\scripts\reactor_faceswap.py", line 101, in process
    result = swap_face(
             ^^^^^^^^^^
  File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\scripts\reactor_swapper.py", line 246, in swap_face
    source_faces = analyze_faces(source_img)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\scripts\reactor_swapper.py", line 152, in analyze_faces
    faces = face_analyser.get(img_data)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\insightface\app\face_analysis.py", line 59, in get
    bboxes, kpss = self.det_model.detect(img,
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\insightface\model_zoo\retinaface.py", line 224, in detect
    scores_list, bboxes_list, kpss_list = self.forward(det_img, self.det_thresh)
                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\insightface\model_zoo\retinaface.py", line 152, in forward
    net_outs = self.session.run(self.output_names, {self.input_name : blob})
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 266, in run
    return self._sess.run(output_names, input_feed, run_options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
onnxruntime.capi.onnxruntime_pybind11_state.Fail: [ONNXRuntimeError] : 1 : FAIL : Non-zero status code returned while running Relu node. Name:'Relu_2' Status Message: CUDA error cudaErrorNoKernelImageForDevice:no kernel image is available for execution on the device

2024-11-14 21:21:17,093 - root - INFO - Prompt executed in 0.09 seconds

Attached Workflow

Please make sure that workflow does not contain any sensitive information such as API keys or passwords.

{"last_node_id":7,"last_link_id":9,"nodes":[{"id":5,"type":"SaveImage","pos":{"0":700,"1":114},"size":{"0":555,"1":565},"flags":{},"order":3,"mode":0,"inputs":[{"name":"images","type":"IMAGE","link":9}],"outputs":[],"properties":{},"widgets_values":["ComfyUI"]},{"id":2,"type":"LoadImage","pos":{"0":-13,"1":71},"size":{"0":323,"1":323},"flags":{},"order":0,"mode":0,"inputs":[],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[7],"slot_index":0},{"name":"MASK","type":"MASK","links":null}],"properties":{"Node name for S&R":"LoadImage"},"widgets_values":["ComfyUI_00048_.png","image"]},{"id":3,"type":"LoadImage","pos":{"0":-16,"1":438},"size":{"0":315,"1":314},"flags":{},"order":1,"mode":0,"inputs":[],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[8],"slot_index":0},{"name":"MASK","type":"MASK","links":null}],"properties":{"Node name for S&R":"LoadImage"},"widgets_values":["ComfyUI_00043_.png","image"]},{"id":7,"type":"ReActorFaceSwapOpt","pos":{"0":212,"1":181},"size":{"0":441,"1":258},"flags":{},"order":2,"mode":0,"inputs":[{"name":"input_image","type":"IMAGE","link":7},{"name":"source_image","type":"IMAGE","link":8,"shape":7},{"name":"face_model","type":"FACE_MODEL","link":null,"shape":7},{"name":"options","type":"OPTIONS","link":null,"shape":7},{"name":"face_boost","type":"FACE_BOOST","link":null,"shape":7}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[9],"slot_index":0},{"name":"FACE_MODEL","type":"FACE_MODEL","links":null}],"properties":{"Node name for S&R":"ReActorFaceSwapOpt"},"widgets_values":[true,"inswapper_128.onnx","YOLOv5l","codeformer-v0.1.0.pth",1,0.5]}],"links":[[7,2,0,7,0,"IMAGE"],[8,3,0,7,1,"IMAGE"],[9,7,0,5,0,"IMAGE"]],"groups":[],"config":{},"extra":{"ds":{"scale":1,"offset":[-46,-7]}},"version":0.4}

Additional Context

(Please add any additional context or steps to reproduce the error here)



### Other

_No response_
ltdrdata commented 2 weeks ago

This issue is related to the dependencies of insightface used in the comfyui-reactor-node custom node, not ComfyUI. Try reinstalling the dependencies according to the installation guide in the repository. If the issue persists, contact the repository for further assistance.

https://github.com/Gourieff/comfyui-reactor-node