support disable.py/enable.py scripts

This commit is contained in:
Dr.Lt.Data
2023-07-23 13:02:00 +09:00
parent f24b506715
commit 3dcf04e324
5 changed files with 82 additions and 62 deletions

View File

@@ -32,7 +32,7 @@ sys.path.append('../..')
from torchvision.datasets.utils import download_url
# ensure .js
print("### Loading: ComfyUI-Manager (V0.13)")
print("### Loading: ComfyUI-Manager (V0.14)")
comfy_ui_revision = "Unknown"
@@ -656,6 +656,15 @@ def gitclone_set_active(files, is_disable):
os.rename(current_path, new_path)
if is_disable:
if os.path.exists(os.path.join(new_path, "disable.py")):
disable_script = [sys.executable, "disable.py"]
try_install_script(url, new_path, disable_script)
else:
if os.path.exists(os.path.join(new_path, "enable.py")):
enable_script = [sys.executable, "enable.py"]
try_install_script(url, new_path, enable_script)
except Exception as e:
print(f"{action_name}(git-clone) error: {url} / {e}")
return False