mirror of
https://git.datalinker.icu/ltdrdata/ComfyUI-Manager
synced 2025-12-10 06:34:24 +08:00
enhance: cm-cli
- restore-snapshot - arbitrary file path is available - show - show unregistered custom nodes
This commit is contained in:
parent
8ff0f1dac3
commit
7bac97dce0
41
cm-cli.py
41
cm-cli.py
@ -108,10 +108,11 @@ def restore_dependencies():
|
|||||||
def restore_snapshot(snapshot_name):
|
def restore_snapshot(snapshot_name):
|
||||||
global processed_install
|
global processed_install
|
||||||
|
|
||||||
snapshot_path = os.path.join(core.comfyui_manager_path, 'snapshots', snapshot_name)
|
if not os.path.exists(snapshot_name):
|
||||||
if not os.path.exists(snapshot_path):
|
snapshot_path = os.path.join(core.comfyui_manager_path, 'snapshots', snapshot_name)
|
||||||
print(f"ERROR: `{snapshot_path}` is not exists.")
|
if not os.path.exists(snapshot_path):
|
||||||
exit(-1)
|
print(f"ERROR: `{snapshot_path}` is not exists.")
|
||||||
|
exit(-1)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
cloned_repos = []
|
cloned_repos = []
|
||||||
@ -420,6 +421,38 @@ def show_list(kind, simple=False):
|
|||||||
else:
|
else:
|
||||||
print(f"{prefix} {k:50}(author: {v['author']})")
|
print(f"{prefix} {k:50}(author: {v['author']})")
|
||||||
|
|
||||||
|
# unregistered nodes
|
||||||
|
candidates = os.listdir(os.path.realpath(custom_nodes_path))
|
||||||
|
|
||||||
|
for k in candidates:
|
||||||
|
fullpath = os.path.join(custom_nodes_path, k)
|
||||||
|
|
||||||
|
if os.path.isfile(fullpath):
|
||||||
|
continue
|
||||||
|
|
||||||
|
if k in ['__pycache__']:
|
||||||
|
continue
|
||||||
|
|
||||||
|
states = set()
|
||||||
|
if k.endswith('.disabled'):
|
||||||
|
prefix = '[ DISABLED ] '
|
||||||
|
states.add('installed')
|
||||||
|
states.add('disabled')
|
||||||
|
states.add('all')
|
||||||
|
k = k[:-9]
|
||||||
|
else:
|
||||||
|
prefix = '[ ENABLED ] '
|
||||||
|
states.add('installed')
|
||||||
|
states.add('enabled')
|
||||||
|
states.add('all')
|
||||||
|
|
||||||
|
if k not in custom_node_map:
|
||||||
|
if kind in states:
|
||||||
|
if simple:
|
||||||
|
print(f"{k:50}")
|
||||||
|
else:
|
||||||
|
print(f"{prefix} {k:50}(author: N/A)")
|
||||||
|
|
||||||
|
|
||||||
def show_snapshot(simple_mode=False):
|
def show_snapshot(simple_mode=False):
|
||||||
json_obj = core.get_current_snapshot()
|
json_obj = core.get_current_snapshot()
|
||||||
|
|||||||
@ -21,7 +21,7 @@ sys.path.append(glob_path)
|
|||||||
import cm_global
|
import cm_global
|
||||||
from manager_util import *
|
from manager_util import *
|
||||||
|
|
||||||
version = [2, 22, 4]
|
version = [2, 23]
|
||||||
version_str = f"V{version[0]}.{version[1]}" + (f'.{version[2]}' if len(version) > 2 else '')
|
version_str = f"V{version[0]}.{version[1]}" + (f'.{version[2]}' if len(version) > 2 else '')
|
||||||
|
|
||||||
comfyui_manager_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
|
comfyui_manager_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user