Browse Source

fix: cm-cli - prevent printing id in list

pull/676/head
Dr.Lt.Data 6 months ago
parent
commit
1646c0c627
  1. 15
      cm-cli.py
  2. 2
      glob/manager_core.py
  3. 12
      node_db/dev/custom-node-list.json

15
cm-cli.py

@ -252,11 +252,11 @@ def load_custom_nodes():
for y in x['files']: for y in x['files']:
if 'github.com' in y and not (y.endswith('.py') or y.endswith('.js')): if 'github.com' in y and not (y.endswith('.py') or y.endswith('.js')):
repo_name = y.split('/')[-1] repo_name = y.split('/')[-1]
res[repo_name] = x res[repo_name] = (x, False)
if 'id' in x: if 'id' in x:
if x['id'] not in res: if x['id'] not in res:
res[x['id']] = x res[x['id']] = (x, True)
return res return res
@ -291,10 +291,10 @@ def lookup_node_path(node_name, robust=False):
exit(-1) exit(-1)
if node_name in custom_node_map: if node_name in custom_node_map:
node_url = custom_node_map[node_name]['files'][0] node_url = custom_node_map[node_name][0]['files'][0]
repo_name = node_url.split('/')[-1] repo_name = node_url.split('/')[-1]
node_path = os.path.join(custom_nodes_path, repo_name) node_path = os.path.join(custom_nodes_path, repo_name)
return node_path, custom_node_map[node_name] return node_path, custom_node_map[node_name][0]
elif robust: elif robust:
node_path = os.path.join(custom_nodes_path, node_name) node_path = os.path.join(custom_nodes_path, node_name)
return node_path, None return node_path, None
@ -473,6 +473,9 @@ def show_list(kind, simple=False):
for k, v in custom_node_map.items(): for k, v in custom_node_map.items():
node_path = os.path.join(custom_nodes_path, k) node_path = os.path.join(custom_nodes_path, k)
if v[1]:
continue
states = set() states = set()
if os.path.exists(node_path): if os.path.exists(node_path):
prefix = '[ ENABLED ] ' prefix = '[ ENABLED ] '
@ -493,8 +496,8 @@ def show_list(kind, simple=False):
if simple: if simple:
print(f"{k:50}") print(f"{k:50}")
else: else:
short_id = v.get('id', "") short_id = v[0].get('id', "")
print(f"{prefix} {k:50} {short_id:20} (author: {v['author']})") print(f"{prefix} {k:50} {short_id:20} (author: {v[0]['author']})")
# unregistered nodes # unregistered nodes
candidates = os.listdir(os.path.realpath(custom_nodes_path)) candidates = os.listdir(os.path.realpath(custom_nodes_path))

2
glob/manager_core.py

@ -23,7 +23,7 @@ sys.path.append(glob_path)
import cm_global import cm_global
from manager_util import * from manager_util import *
version = [2, 31] version = [2, 31, 1]
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__), '..'))

12
node_db/dev/custom-node-list.json

@ -10,9 +10,19 @@
}, },
{
"author": "shadowcz007",
"title": "ComfyUI-PuLID [TEST]",
"reference": "https://github.com/shadowcz007/ComfyUI-PuLID-Test",
"files": [
"https://github.com/shadowcz007/ComfyUI-PuLID-Test"
],
"install_type": "git-clone",
"description": "[a/PuLID](https://github.com/ToTheBeginning/PuLID) ComfyUI native implementation."
},
{ {
"author": "sangeet", "author": "sangeet",
"title": "comfyui-testui", "title": "comfyui-testui [TEST]",
"reference": "https://github.com/sangeet/comfyui-testui", "reference": "https://github.com/sangeet/comfyui-testui",
"files": [ "files": [
"https://github.com/sangeet/comfyui-testui" "https://github.com/sangeet/comfyui-testui"

Loading…
Cancel
Save