Gourieff / comfyui-reactor-node

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

AttributeError: module 'onnxruntime' has no attribute 'InferenceSession' #397

Open fableman73 opened 4 weeks ago

fableman73 commented 4 weeks ago

First, confirm

What happened?

Installing from manager and restarting the comfyui server results in error: I removed it and re installed many times and computer restarts, nothing helps.

It worked before but I think some other node broke it, but I can't figure out what or why.

Steps to reproduce the problem

Your workflow Install the node from manager

Sysinfo

Win11. Latest comfyui

Relevant console log

## Execute install/(de)activation script for 'C:\AI\ComfyUI\custom_nodes\comfyui-reactor-node'
 CUDA 12.1
 Ok

[ComfyUI-Manager] Startup script completed.
#######################################################################

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

Total VRAM 11264 MB, total RAM 32679 MB
pytorch version: 2.4.0+cu121
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 2080 Ti : cudaMallocAsync
Using pytorch cross attention
[Prompt Server] web root: c:\AI\ComfyUI\web
C:\Users\Fableman\AppData\Local\Programs\Python\Python310\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)
### Loading: ComfyUI-Impact-Pack (V7.1)
### Loading: ComfyUI-Impact-Pack (Subpack: V0.6)
[Impact Pack] Wildcards loading done.
### Loading: ComfyUI-Manager (V2.50.1)
### ComfyUI Revision: 2584 [ea63b1c0] | Released on '2024-08-20'
[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/alter-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\nodes.py", line 1993, in load_custom_node
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "C:\AI\ComfyUI\custom_nodes\comfyui-reactor-node\__init__.py", line 23, in <module>
    from .nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
  File "C:\AI\ComfyUI\custom_nodes\comfyui-reactor-node\nodes.py", line 15, in <module>
    from insightface.app.common import Face
  File "C:\Users\Fableman\AppData\Local\Programs\Python\Python310\lib\site-packages\insightface\__init__.py", line 16, in <module>
    from . import model_zoo
  File "C:\Users\Fableman\AppData\Local\Programs\Python\Python310\lib\site-packages\insightface\model_zoo\__init__.py", line 1, in <module>
    from .model_zoo import get_model
  File "C:\Users\Fableman\AppData\Local\Programs\Python\Python310\lib\site-packages\insightface\model_zoo\model_zoo.py", line 22, in <module>
    class PickableInferenceSession(onnxruntime.InferenceSession):
AttributeError: module 'onnxruntime' has no attribute 'InferenceSession'

Cannot import C:\AI\ComfyUI\custom_nodes\comfyui-reactor-node module for custom nodes: module 'onnxruntime' has no attribute 'InferenceSession'

Import times for custom nodes:
   0.0 seconds: C:\AI\ComfyUI\custom_nodes\ComfyUI-Advanced-ControlNet
   0.0 seconds: C:\AI\ComfyUI\custom_nodes\ComfyUI_IPAdapter_plus
   0.0 seconds: C:\AI\ComfyUI\custom_nodes\CharacterFaceSwap
   0.0 seconds: C:\AI\ComfyUI\custom_nodes\facerestore_cf
   0.1 seconds (IMPORT FAILED): C:\AI\ComfyUI\custom_nodes\comfyui-reactor-node
   0.3 seconds: C:\AI\ComfyUI\custom_nodes\ComfyUI-Manager
   1.0 seconds: C:\AI\ComfyUI\custom_nodes\ComfyUI-Impact-Pack

Starting server

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

Additional information

No response

Gourieff commented 6 days ago

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