From 63606d7de7d3022a0b83e297a77de4d970b85862 Mon Sep 17 00:00:00 2001 From: Level Pixel Dev Date: Thu, 5 Jun 2025 02:06:38 +0600 Subject: [PATCH] Changing installer for onnxruntime due to conflicts --- install_init.py | 13 ++----------- pyproject.toml | 5 ++--- requirements.txt | 1 - 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/install_init.py b/install_init.py index 3eea220..a6d4786 100644 --- a/install_init.py +++ b/install_init.py @@ -344,32 +344,23 @@ def install(pkg_spec: str): print(f"Failed to install {pkg_spec}: {e}") return -def uninstall(pkg: str): - try: - subprocess.check_call([sys.executable, '-m', 'pip', 'uninstall', '-y', pkg]) - except subprocess.CalledProcessError as e: - print(f"Failed to uninstall {pkg}: {e}") - return - def install_onnxruntime(): import torch gpu = torch.cuda.is_available() print(f"Found NVIDIA GPU: {gpu}") if gpu: if is_installed('onnxruntime'): - uninstall("onnxruntime") print(f"LP >>> Your python has the 'onnxruntime' library installed, although your computer supports 'onnxruntime-gpu'.") print(f"LP >>> Solution: If other node packages do not use the 'onnxruntime' library, then remove the 'onnxruntime' library for your python.") print(f"LP >>> Close ComfyUI and run the script at .\\ComfyUI\\custom_nodes\\ComfyUI-LevelPixel-Advanced\\scripts\\remove_onnxruntime.bat") - if not is_installed('onnxruntime-gpu'): + elif not is_installed('onnxruntime-gpu'): install("onnxruntime-gpu>=1.22") else: if is_installed('onnxruntime-gpu'): - uninstall("onnxruntime-gpu") print(f"LP >>> Your python has the 'onnxruntime-gpu' library installed, but you don't have a GPU.") print(f"LP >>> Solution: If other node packages do not use the 'onnxruntime-gpu' library, then remove the 'onnxruntime-gpu' library for your python.") print(f"LP >>> Close ComfyUI and run the script at .\\ComfyUI\\custom_nodes\\ComfyUI-LevelPixel-Advanced\\scripts\\remove_onnxruntime.bat") - if not is_installed('onnxruntime'): + elif not is_installed('onnxruntime'): install("onnxruntime>=1.22") def init(check_imports=None): diff --git a/pyproject.toml b/pyproject.toml index 6fb23f5..2a9109d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "comfyui-levelpixel-advanced" description = "Advanced nodes of the Level Pixel company (aka levelpixel, LP). Includes convenient advanced nodes for working with LLM и VLM models (LLaVa, Multimodal Generator) with GGUF format. Qwen2.5-VL and Qwen2.5 supported, based on llama-mtmd. Also included is a node for the RAM model. Nodes have the ability to automatically unload models from VRAM. This package also includes Autotagger (WD), Image Remove Background (based on RMBG-2.0, on BiRefNet, on BiRefNet-HR-Matter, on RemBG). Licensed under GNU GPLv3. Repository: https://github.com/LevelPixel/ComfyUI-LevelPixel-Advanced" -version = "1.2.8" +version = "1.2.9" license = { file = "LICENSE.txt" } dependencies = [ "torch>=2.0.1", @@ -19,8 +19,7 @@ dependencies = [ "rembg>=2.0.66", "diskcache>=5.6.1", "jinja2>=2.11.3", - "typing-extensions>=4.5.0", - "onnxruntime-gpu>=1.22" ] + "typing-extensions>=4.5.0" ] [project.urls] Repository = "https://github.com/LevelPixel/ComfyUI-LevelPixel-Advanced" diff --git a/requirements.txt b/requirements.txt index b58d951..64340de 100644 --- a/requirements.txt +++ b/requirements.txt @@ -15,5 +15,4 @@ matplotlib diskcache>=5.6.1 jinja2>=2.11.3 typing-extensions>=4.5.0 -onnxruntime-gpu>=1.22 ram @ git+https://github.com/xinyu1205/recognize-anything.git