mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2025-12-18 19:03:06 +08:00
added: should_be_disabled function
This commit is contained in:
parent
539e0a1534
commit
bb0fcf6ea6
@ -1,6 +1,7 @@
|
|||||||
import os
|
import os
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
|
||||||
def prestartup():
|
def prestartup():
|
||||||
from . import prestartup_script # noqa: F401
|
from . import prestartup_script # noqa: F401
|
||||||
logging.info('[PRE] ComfyUI-Manager')
|
logging.info('[PRE] ComfyUI-Manager')
|
||||||
@ -15,3 +16,18 @@ def start():
|
|||||||
if os.environ.get('ENABLE_LEGACY_COMFYUI_MANAGER_FRONT', 'false') == 'true':
|
if os.environ.get('ENABLE_LEGACY_COMFYUI_MANAGER_FRONT', 'false') == 'true':
|
||||||
import nodes
|
import nodes
|
||||||
nodes.EXTENSION_WEB_DIRS['comfyui-manager-legacy'] = os.path.join(os.path.dirname(__file__), 'js')
|
nodes.EXTENSION_WEB_DIRS['comfyui-manager-legacy'] = os.path.join(os.path.dirname(__file__), 'js')
|
||||||
|
|
||||||
|
|
||||||
|
def should_be_disabled(fullpath:str) -> bool:
|
||||||
|
"""
|
||||||
|
1. Disables the legacy ComfyUI-Manager.
|
||||||
|
2. The blocklist can be expanded later based on policies.
|
||||||
|
"""
|
||||||
|
|
||||||
|
# In cases where installation is done via a zip archive, the directory name may not be comfyui-manager, and it may not contain a git repository.
|
||||||
|
# It is assumed that any installed legacy ComfyUI-Manager will have at least 'comfyui-manager' in its directory name.
|
||||||
|
dir_name = os.path.basename(fullpath).lower()
|
||||||
|
if 'comfyui-manager' in dir_name:
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user