-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path__init__.py
31 lines (25 loc) · 914 Bytes
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import os
import sys
import subprocess
import pkg_resources
# Add the current directory to the Python path
current_dir = os.path.dirname(os.path.abspath(__file__))
if current_dir not in sys.path:
sys.path.append(current_dir)
# Function to upgrade a package
def upgrade_package(package):
subprocess.check_call([sys.executable, "-m", "pip", "install", "--upgrade", package])
# Upgrade packages from requirements.txt
requirements = [
"git+https://github.com/huggingface/diffusers",
"transformers",
"accelerate"
]
for requirement in requirements:
try:
upgrade_package(requirement)
except Exception as e:
print(f"Failed to upgrade {requirement}: {str(e)}")
# Import after upgrading packages
from .lumina_diffusers_node import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
__all__ = ['NODE_CLASS_MAPPINGS', 'NODE_DISPLAY_NAME_MAPPINGS']