From a9162791b3ef3c48e5540522c48f3fbdecf8c91b Mon Sep 17 00:00:00 2001 From: "dr.lt.data" Date: Tue, 2 Jan 2024 18:25:26 +0900 Subject: [PATCH] fix: robust cm_global --- __init__.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/__init__.py b/__init__.py index df50e07d..77dee6bb 100644 --- a/__init__.py +++ b/__init__.py @@ -301,14 +301,17 @@ def print_comfyui_version(): comfy_ui_commit_date = repo.head.commit.committed_datetime.date() # process on_revision_detected --> - for k, f in cm_global.variables['cm.on_revision_detected_handler']: - try: - f(comfy_ui_revision) - except Exception: - print(f"[ERROR] '{k}' on_revision_detected_handler") - traceback.print_exc() + if 'cm.on_revision_detected_handler' in cm_global.variables: + for k, f in cm_global.variables['cm.on_revision_detected_handler']: + try: + f(comfy_ui_revision) + except Exception: + print(f"[ERROR] '{k}' on_revision_detected_handler") + traceback.print_exc() - del cm_global.variables['cm.on_revision_detected_handler'] + del cm_global.variables['cm.on_revision_detected_handler'] + else: + print(f"[ComfyUI-Manager] Some features are restricted due to your ComfyUI being outdated.") # <-- if current_branch == "master":