update
This commit is contained in:
+2
-2
@@ -1,4 +1,5 @@
|
||||
import os
|
||||
import os, sys
|
||||
|
||||
main_path = os.path.dirname(__file__)
|
||||
sys.path.append(main_path)
|
||||
|
||||
@@ -21,7 +22,6 @@ def urldownload_progressbar(url, file_path):
|
||||
progress_bar.update(len(chunk))
|
||||
|
||||
progress_bar.close()
|
||||
|
||||
|
||||
print("Start Setting weights")
|
||||
for url, filename in zip(urls, filenames):
|
||||
|
||||
+7
-8
@@ -11,6 +11,7 @@ import re
|
||||
main_path = os.path.dirname(__file__)
|
||||
sys.path.append(main_path)
|
||||
|
||||
windows_not_install = ['mmcv_full']
|
||||
|
||||
def handle_stream(stream, is_stdout):
|
||||
stream.reconfigure(encoding=locale.getpreferredencoding(), errors='replace')
|
||||
@@ -21,7 +22,6 @@ def handle_stream(stream, is_stdout):
|
||||
else:
|
||||
print(msg, end="", file=sys.stderr)
|
||||
|
||||
|
||||
def process_wrap(cmd_str, cwd=None, handler=None):
|
||||
print(f"[Impact Pack] EXECUTE: {cmd_str} in '{cwd}'")
|
||||
process = subprocess.Popen(cmd_str, cwd=cwd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, bufsize=1)
|
||||
@@ -40,11 +40,9 @@ def process_wrap(cmd_str, cwd=None, handler=None):
|
||||
|
||||
return process.wait()
|
||||
|
||||
|
||||
# ---
|
||||
pip_list = None
|
||||
|
||||
|
||||
def get_installed_packages():
|
||||
global pip_list
|
||||
if pip_list is None:
|
||||
@@ -57,7 +55,6 @@ def get_installed_packages():
|
||||
|
||||
return pip_list
|
||||
|
||||
|
||||
def is_installed(name):
|
||||
name = name.strip()
|
||||
pattern = r'([^<>!=]+)([<>!=]=?)'
|
||||
@@ -69,7 +66,6 @@ def is_installed(name):
|
||||
result = name.lower() in get_installed_packages()
|
||||
return result
|
||||
|
||||
|
||||
def check_and_install_requirements(file_path):
|
||||
print(f"req_path: {file_path}")
|
||||
if os.path.exists(file_path):
|
||||
@@ -77,13 +73,16 @@ def check_and_install_requirements(file_path):
|
||||
lines = file.readlines()
|
||||
for line in lines:
|
||||
if not is_installed(line):
|
||||
process_wrap(pip_install + [line], cwd=main_path)
|
||||
return False
|
||||
if platform.system() == "Windows" and line in windows_not_install:
|
||||
continue
|
||||
else:
|
||||
process_wrap(pip_install + [line], cwd=main_path)
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
try:
|
||||
import platform
|
||||
|
||||
print("### ComfyUI-Impact-Pack: Check dependencies")
|
||||
if "python_embeded" in sys.executable or "python_embedded" in sys.executable:
|
||||
pip_install = [sys.executable, '-s', '-m', 'pip', 'install']
|
||||
|
||||
@@ -9,3 +9,4 @@ scikit-image
|
||||
matplotlib
|
||||
insightface
|
||||
diffusers==0.18.2
|
||||
mmcv_full
|
||||
|
||||
Reference in New Issue
Block a user