pythongosssss / ComfyUI-WD14-Tagger

A ComfyUI extension allowing for the interrogation of booru tags from images.
MIT License
597 stars 70 forks source link

Older onnxruntime==1.15.0 causes failures #47

Open Johnz86 opened 5 months ago

Johnz86 commented 5 months ago

After update with comfyui-manager the start of the comfyui-WD14-tagger failed:

I get following error:

D:\Programovanie\Python\stable-diffusion-web\ComfyUI\venv\lib\site-packages\transformers\utils\generic.py:309: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead.
  _torch_pytree._register_pytree_node(
MNeMiC Nodes: Loaded
Traceback (most recent call last):
  File "D:\Programovanie\Python\stable-diffusion-web\ComfyUI\nodes.py", line 1864, 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 "D:\Programovanie\Python\stable-diffusion-web\ComfyUI\custom_nodes\ComfyUI-WD14-Tagger\__init__.py", line 4, in <module>
    from .wd14tagger import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
  File "D:\Programovanie\Python\stable-diffusion-web\ComfyUI\custom_nodes\ComfyUI-WD14-Tagger\wd14tagger.py", line 10, in <module>
    import onnxruntime as ort
  File "D:\Programovanie\Python\stable-diffusion-web\ComfyUI\venv\lib\site-packages\onnxruntime\__init__.py", line 57, in <module>
    raise import_capi_exception
  File "D:\Programovanie\Python\stable-diffusion-web\ComfyUI\venv\lib\site-packages\onnxruntime\__init__.py", line 37, in <module>
    from onnxruntime.capi._pybind_state import create_and_register_allocator_v2  # noqa: F401
ImportError: cannot import name 'create_and_register_allocator_v2' from 'onnxruntime.capi._pybind_state' (D:\Programovanie\Python\stable-diffusion-web\ComfyUI\venv\lib\site-packages\onnxruntime\capi\_pybind_state.py)

Cannot import D:\Programovanie\Python\stable-diffusion-web\ComfyUI\custom_nodes\ComfyUI-WD14-Tagger module for custom nodes: cannot import name 'create_and_register_allocator_v2' from 'onnxruntime.capi._pybind_state' (D:\Programovanie\Python\stable-diffusion-web\ComfyUI\venv\lib\site-packages\onnxruntime\capi\_pybind_state.py)

After pip install onnxruntime==1.17.3 the issue was resolved.

Please specify the supported version in requirements.txt