Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ONNXRuntimeError] ComfyUI-WD14-Tagger #60

Open
Vigilence opened this issue Jun 13, 2024 · 7 comments
Open

[ONNXRuntimeError] ComfyUI-WD14-Tagger #60

Vigilence opened this issue Jun 13, 2024 · 7 comments

Comments

@Vigilence
Copy link

I was able to use ComfyUI-WD14-Tagger fine yesterday with the v3 models but today they give this error. Everything, including comfyui and the nodes are up to date.

Screenshot 2024-06-13 161929
Screenshot 2024-06-13 161937

Error occurred when executing WD14Tagger|pysssss:

[ONNXRuntimeError] : 1 : FAIL : Load model from I:\StabilityMatrix-win-x64\Data\Packages\ComfyUI\custom_nodes\ComfyUI-WD14-Tagger\models\wd-vit-tagger-v3.onnx failed:D:\a\_work\1\s\onnxruntime\core/graph/model_load_utils.h:56 onnxruntime::model_load_utils::ValidateOpsetForDomain ONNX Runtime only *guarantees* support for models stamped with official released onnx opset versions. Opset 4 is under development and support for this is limited. The operator schemas and or other functionality may change before next ONNX release and in this case ONNX Runtime will not guarantee backward compatibility. Current official support for domain ai.onnx.ml is till opset 3.


  File "I:\StabilityMatrix-win-x64\Data\Packages\ComfyUI\execution.py", line 151, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
  File "I:\StabilityMatrix-win-x64\Data\Packages\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 "I:\StabilityMatrix-win-x64\Data\Packages\ComfyUI\execution.py", line 74, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
  File "I:\StabilityMatrix-win-x64\Data\Packages\ComfyUI\custom_nodes\ComfyUI-WD14-Tagger\wd14tagger.py", line 200, in tag
    tags.append(wait_for_async(lambda: tag(image, model, threshold, character_threshold, exclude_tags, replace_underscore, trailing_comma)))
  File "I:\StabilityMatrix-win-x64\Data\Packages\ComfyUI\custom_nodes\ComfyUI-WD14-Tagger\pysssss.py", line 214, in wait_for_async
    loop.run_until_complete(run_async())
  File "asyncio\base_events.py", line 649, in run_until_complete
  File "I:\StabilityMatrix-win-x64\Data\Packages\ComfyUI\custom_nodes\ComfyUI-WD14-Tagger\pysssss.py", line 204, in run_async
    r = await async_fn()
  File "I:\StabilityMatrix-win-x64\Data\Packages\ComfyUI\custom_nodes\ComfyUI-WD14-Tagger\wd14tagger.py", line 58, in tag
    model = InferenceSession(name, providers=defaults["ortProviders"])
  File "I:\StabilityMatrix-win-x64\Data\Packages\ComfyUI\venv\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 383, in __init__
    self._create_inference_session(providers, provider_options, disabled_optimizers)
  File "I:\StabilityMatrix-win-x64\Data\Packages\ComfyUI\venv\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 424, in _create_inference_session
    sess = C.InferenceSession(session_options, self._model_path, True, self._read_config_from_model)
@alenknight
Copy link

same issue here. came from comfyanonymous/ComfyUI#3716 (comment) - but yeah I'm getting the same error.

@DarkAlchy
Copy link

I just used this until midnight my time then BOOM: onnxruntime::model_load_utils::ValidateOpsetForDomain ONNX Runtime only guarantees support for models stamped with official released onnx opset versions. Opset 4 is under development and support for this is limited. The operator schemas and or other functionality may change before next ONNX release and in this case ONNX Runtime will not guarantee backward compatibility. Current official support for domain ai.onnx.ml is till opset 3.

@gabriel-filincowsky
Copy link

Try the following.

  1. Exit ComfyUI (close the CMD window).
  2. Uninstall 'onnxruntime' by running the following script from the '\comfy\python_embeded' folder:
@echo off
setlocal enabledelayedexpansion

echo Checking for python.exe in the current directory...

if not exist "python.exe" (
   echo python.exe not found in the current directory.
   echo Please make sure you've placed this script in the 'python_embeded' folder.
   pause
   exit /b 1
)

echo Python executable found in the current directory.

echo Uninstalling onnxruntime...
python.exe -s -m pip uninstall -y onnxruntime

echo.
echo Uninstalling onnxruntime-gpu...
python.exe -s -m pip uninstall -y onnxruntime-gpu

echo.
echo Uninstallation complete.
pause

You can save this script as a .bat file and place it into the '\comfy\python_embeded' folder.

  1. Run ComfyUI.
  2. Go to Manager, select 'Install missing custom nodes,' then click the 'Try to fix it' button.
  3. Restart ComfyUI

Please let me know if this works for you. I noticed that every time I update ComfyUI, I get 'onnxruntime' errors, so I have to go through this process again.

@MilAIDou
Copy link

Try the following.

1. Exit ComfyUI (close the CMD window).

2. Uninstall 'onnxruntime' by running the following script from the **_'\comfy\python_embeded'_ folder**:
@echo off
setlocal enabledelayedexpansion

echo Checking for python.exe in the current directory...

if not exist "python.exe" (
   echo python.exe not found in the current directory.
   echo Please make sure you've placed this script in the 'python_embeded' folder.
   pause
   exit /b 1
)

echo Python executable found in the current directory.

echo Uninstalling onnxruntime...
python.exe -s -m pip uninstall -y onnxruntime

echo.
echo Uninstalling onnxruntime-gpu...
python.exe -s -m pip uninstall -y onnxruntime-gpu

echo.
echo Uninstallation complete.
pause

You can save this script as a .bat file and place it into the '\comfy\python_embeded' folder.

3. Run ComfyUI.

4. Go to Manager, select 'Install missing custom nodes,' then click the 'Try to fix it' button.

5. Restart ComfyUI

Please let me know if this works for you. I noticed that every time I update ComfyUI, I get 'onnxruntime' errors, so I have to go through this process again.

Thx for your answer, I solved this issues. Really thanks!

@iiidsoul
Copy link

Try the following.

  1. Exit ComfyUI (close the CMD window).
  2. Uninstall 'onnxruntime' by running the following script from the '\comfy\python_embeded' folder:
@echo off
setlocal enabledelayedexpansion

echo Checking for python.exe in the current directory...

if not exist "python.exe" (
   echo python.exe not found in the current directory.
   echo Please make sure you've placed this script in the 'python_embeded' folder.
   pause
   exit /b 1
)

echo Python executable found in the current directory.

echo Uninstalling onnxruntime...
python.exe -s -m pip uninstall -y onnxruntime

echo.
echo Uninstalling onnxruntime-gpu...
python.exe -s -m pip uninstall -y onnxruntime-gpu

echo.
echo Uninstallation complete.
pause

You can save this script as a .bat file and place it into the '\comfy\python_embeded' folder.

  1. Run ComfyUI.
  2. Go to Manager, select 'Install missing custom nodes,' then click the 'Try to fix it' button.
  3. Restart ComfyUI

Please let me know if this works for you. I noticed that every time I update ComfyUI, I get 'onnxruntime' errors, so I have to go through this process again.

Thank you! You solved the issues!

@Apyr101
Copy link

Apyr101 commented Sep 21, 2024

Try the following.

1. Exit ComfyUI (close the CMD window).

2. Uninstall 'onnxruntime' by running the following script from the **_'\comfy\python_embeded'_ folder**:
@echo off
setlocal enabledelayedexpansion

echo Checking for python.exe in the current directory...

if not exist "python.exe" (
   echo python.exe not found in the current directory.
   echo Please make sure you've placed this script in the 'python_embeded' folder.
   pause
   exit /b 1
)

echo Python executable found in the current directory.

echo Uninstalling onnxruntime...
python.exe -s -m pip uninstall -y onnxruntime

echo.
echo Uninstalling onnxruntime-gpu...
python.exe -s -m pip uninstall -y onnxruntime-gpu

echo.
echo Uninstallation complete.
pause

You can save this script as a .bat file and place it into the '\comfy\python_embeded' folder.

3. Run ComfyUI.

4. Go to Manager, select 'Install missing custom nodes,' then click the 'Try to fix it' button.

5. Restart ComfyUI

Please let me know if this works for you. I noticed that every time I update ComfyUI, I get 'onnxruntime' errors, so I have to go through this process again.

Worked perfectly, thank you!

@1974320861
Copy link

Try the following.

  1. Exit ComfyUI (close the CMD window).
  2. Uninstall 'onnxruntime' by running the following script from the '\comfy\python_embeded' folder:
@echo off
setlocal enabledelayedexpansion

echo Checking for python.exe in the current directory...

if not exist "python.exe" (
   echo python.exe not found in the current directory.
   echo Please make sure you've placed this script in the 'python_embeded' folder.
   pause
   exit /b 1
)

echo Python executable found in the current directory.

echo Uninstalling onnxruntime...
python.exe -s -m pip uninstall -y onnxruntime

echo.
echo Uninstalling onnxruntime-gpu...
python.exe -s -m pip uninstall -y onnxruntime-gpu

echo.
echo Uninstallation complete.
pause

You can save this script as a .bat file and place it into the '\comfy\python_embeded' folder.

  1. Run ComfyUI.
  2. Go to Manager, select 'Install missing custom nodes,' then click the 'Try to fix it' button.
  3. Restart ComfyUI

Please let me know if this works for you. I noticed that every time I update ComfyUI, I get 'onnxruntime' errors, so I have to go through this process again.

i resolved by it , thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants