refactor: use cm_global instead of sys.CM_api
feat: register extension information
This commit is contained in:
+11
@@ -468,3 +468,14 @@ except Exception as e:
|
||||
|
||||
WEB_DIRECTORY = "js"
|
||||
__all__ = ['NODE_CLASS_MAPPINGS', 'NODE_DISPLAY_NAME_MAPPINGS']
|
||||
|
||||
|
||||
try:
|
||||
import cm_global
|
||||
cm_global.register_extension('ComfyUI-Impact-Pack',
|
||||
{'version': config.version_code,
|
||||
'name': 'Impact Pack',
|
||||
'nodes': set(NODE_CLASS_MAPPINGS.keys()),
|
||||
'description': 'This extension provides inpainting functionality based on the detector and detailer, along with convenient workflow features like wildcards and logics.', })
|
||||
except:
|
||||
pass
|
||||
|
||||
@@ -2,7 +2,8 @@ import configparser
|
||||
import os
|
||||
|
||||
|
||||
version = "V4.56.1"
|
||||
version_code = [4, 57]
|
||||
version = f"V{version_code[0]}.{version_code[1]}" + (f'.{version_code[2]}' if len(version_code) > 2 else '')
|
||||
|
||||
dependency_version = 20
|
||||
|
||||
|
||||
@@ -432,7 +432,7 @@ class ImpactSleep:
|
||||
|
||||
error_skip_flag = False
|
||||
try:
|
||||
import sys
|
||||
import cm_global
|
||||
def filter_message(str):
|
||||
global error_skip_flag
|
||||
|
||||
@@ -444,7 +444,7 @@ try:
|
||||
else:
|
||||
return False
|
||||
|
||||
sys.__comfyui_manager_register_message_collapse(filter_message)
|
||||
cm_global.try_call(api='cm.register_message_collapse', f=filter_message)
|
||||
|
||||
except Exception as e:
|
||||
print(f"[WARN] ComfyUI-Impact-Pack: `ComfyUI` or `ComfyUI-Manager` is an outdated version.")
|
||||
|
||||
@@ -521,12 +521,11 @@ def apply_mask_alpha_to_pil(decoded_pil, mask):
|
||||
|
||||
|
||||
def try_install_custom_node(custom_node_url, msg):
|
||||
import sys
|
||||
try:
|
||||
confirm_try_install = sys.CM_api['cm.try-install-custom-node']
|
||||
print(f"confirm_try_install: {confirm_try_install}")
|
||||
confirm_try_install('Impact Pack', custom_node_url, msg)
|
||||
except Exception as e:
|
||||
import cm_global
|
||||
cm_global.try_call(api='cm.try-install-custom-node',
|
||||
sender="Impact Pack", custom_node_url=custom_node_url, msg=msg)
|
||||
except Exception:
|
||||
print(msg)
|
||||
print(f"[Impact Pack] ComfyUI-Manager is outdated. The custom node installation feature is not available.")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user