diff --git a/comfyui_manager/__init__.py b/comfyui_manager/__init__.py index aba770e5..e396547c 100644 --- a/comfyui_manager/__init__.py +++ b/comfyui_manager/__init__.py @@ -13,18 +13,21 @@ def start(): logging.info('[START] ComfyUI-Manager') from .common import cm_global # noqa: F401 - should_show_legacy_manager_front = os.environ.get('ENABLE_LEGACY_COMFYUI_MANAGER_FRONT', 'false') == 'true' or ENABLE_LEGACY_COMFYUI_MANAGER_FRONT_DEFAULT - if not args.disable_manager and should_show_legacy_manager_front: - try: - from .legacy import manager_server # noqa: F401 - from .legacy import share_3rdparty # noqa: F401 - import nodes - nodes.EXTENSION_WEB_DIRS['comfyui-manager-legacy'] = os.path.join(os.path.dirname(__file__), 'js') - except Exception as e: - print("Error enabling legacy ComfyUI Manager frontend:", e) - else: - from .glob import manager_server # noqa: F401 - from .glob import share_3rdparty # noqa: F401 + if not args.disable_manager: + should_show_legacy_manager_front = args.enable_manager_legacy_ui or ENABLE_LEGACY_COMFYUI_MANAGER_FRONT_DEFAULT + if should_show_legacy_manager_front: + try: + from .legacy import manager_server # noqa: F401 + from .legacy import share_3rdparty # noqa: F401 + import nodes + + logging.info("[ComfyUI-Manager] Legacy UI is enabled.") + nodes.EXTENSION_WEB_DIRS['comfyui-manager-legacy'] = os.path.join(os.path.dirname(__file__), 'js') + except Exception as e: + print("Error enabling legacy ComfyUI Manager frontend:", e) + else: + from .glob import manager_server # noqa: F401 + from .glob import share_3rdparty # noqa: F401 def should_be_disabled(fullpath:str) -> bool: