mirror of
https://git.datalinker.icu/ltdrdata/ComfyUI-Manager
synced 2025-12-13 08:04:24 +08:00
Only load legacy FE extension if --enable-manager-legacy-ui is set (#1746)
* only load JS extensions when legacy arg is set * add `is_legacy_manager_ui` endpoint
This commit is contained in:
parent
1816bb748e
commit
abfd85602e
@ -2,8 +2,6 @@ import os
|
|||||||
import logging
|
import logging
|
||||||
from comfy.cli_args import args
|
from comfy.cli_args import args
|
||||||
|
|
||||||
ENABLE_LEGACY_COMFYUI_MANAGER_FRONT_DEFAULT = True # Enable legacy ComfyUI Manager frontend while new UI is in beta phase
|
|
||||||
|
|
||||||
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')
|
||||||
@ -14,8 +12,7 @@ def start():
|
|||||||
from .common import cm_global # noqa: F401
|
from .common import cm_global # noqa: F401
|
||||||
|
|
||||||
if not args.disable_manager:
|
if not args.disable_manager:
|
||||||
should_show_legacy_manager_front = args.enable_manager_legacy_ui or ENABLE_LEGACY_COMFYUI_MANAGER_FRONT_DEFAULT
|
if args.enable_manager_legacy_ui:
|
||||||
if should_show_legacy_manager_front:
|
|
||||||
try:
|
try:
|
||||||
from .legacy import manager_server # noqa: F401
|
from .legacy import manager_server # noqa: F401
|
||||||
from .legacy import share_3rdparty # noqa: F401
|
from .legacy import share_3rdparty # noqa: F401
|
||||||
|
|||||||
@ -991,6 +991,13 @@ def populate_markdown(x):
|
|||||||
if 'title' in x:
|
if 'title' in x:
|
||||||
x['title'] = manager_util.sanitize_tag(x['title'])
|
x['title'] = manager_util.sanitize_tag(x['title'])
|
||||||
|
|
||||||
|
@routes.get("/v2/manager/is_legacy_manager_ui")
|
||||||
|
async def is_legacy_manager_ui(request):
|
||||||
|
return web.json_response(
|
||||||
|
{"is_legacy_manager_ui": args.enable_manager_legacy_ui},
|
||||||
|
content_type="application/json",
|
||||||
|
status=200,
|
||||||
|
)
|
||||||
|
|
||||||
# freeze imported version
|
# freeze imported version
|
||||||
startup_time_installed_node_packs = core.get_installed_node_packs()
|
startup_time_installed_node_packs = core.get_installed_node_packs()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user