Changing installer for onnxruntime due to conflicts

This commit is contained in:
Level Pixel Dev
2025-06-05 02:06:38 +06:00
parent e0b340f262
commit 63606d7de7
3 changed files with 4 additions and 15 deletions
+2 -11
View File
@@ -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):
+2 -3
View File
@@ -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"
-1
View File
@@ -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