mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2026-02-13 14:42:40 +08:00
improved: add mode=imported for startup snapshot
`/customnode/installed` - current snapshot `/customnode/installed?mode=imported` - startup snapshot
This commit is contained in:
parent
0f73a69d7d
commit
7d9df9cc47
@ -1396,6 +1396,24 @@ def identify_node_pack_from_path(fullpath):
|
|||||||
return module_name, commit_hash, ''
|
return module_name, commit_hash, ''
|
||||||
|
|
||||||
|
|
||||||
|
def get_installed_node_packs():
|
||||||
|
res = {}
|
||||||
|
|
||||||
|
for x in get_custom_nodes_paths():
|
||||||
|
for y in os.listdir(x):
|
||||||
|
if y == '__pycache__' or y.endswith('.disabled'):
|
||||||
|
continue
|
||||||
|
|
||||||
|
fullpath = os.path.join(x, y)
|
||||||
|
info = identify_node_pack_from_path(fullpath)
|
||||||
|
if info is None:
|
||||||
|
continue
|
||||||
|
|
||||||
|
res[info[0]] = [info[1], info[2]]
|
||||||
|
|
||||||
|
return res
|
||||||
|
|
||||||
|
|
||||||
def get_channel_dict():
|
def get_channel_dict():
|
||||||
global channel_dict
|
global channel_dict
|
||||||
|
|
||||||
|
|||||||
@ -537,21 +537,16 @@ def populate_markdown(x):
|
|||||||
x['title'] = manager_util.sanitize_tag(x['title'])
|
x['title'] = manager_util.sanitize_tag(x['title'])
|
||||||
|
|
||||||
|
|
||||||
|
# freeze imported version
|
||||||
|
startup_time_installed_node_packs = core.get_installed_node_packs()
|
||||||
@routes.get("/customnode/installed")
|
@routes.get("/customnode/installed")
|
||||||
async def installed_list(request):
|
async def installed_list(request):
|
||||||
res = {}
|
mode = request.query.get('mode', 'default')
|
||||||
|
|
||||||
for x in core.get_custom_nodes_paths():
|
if mode == 'imported':
|
||||||
for y in os.listdir(x):
|
res = startup_time_installed_node_packs
|
||||||
if y == '__pycache__' or y.endswith('.disabled'):
|
else:
|
||||||
continue
|
res = core.get_installed_node_packs()
|
||||||
|
|
||||||
fullpath = os.path.join(x, y)
|
|
||||||
info = core.identify_node_pack_from_path(fullpath)
|
|
||||||
if info is None:
|
|
||||||
continue
|
|
||||||
|
|
||||||
res[info[0]] = [info[1], info[2]]
|
|
||||||
|
|
||||||
return web.json_response(res, content_type='application/json')
|
return web.json_response(res, content_type='application/json')
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user