mirror of
https://git.datalinker.icu/ltdrdata/ComfyUI-Manager
synced 2025-12-08 21:54:26 +08:00
improved: Update All - Show link on the result board
fixed: Update All - Updates for unknown nodes were not being applied fixed: corner case crash whilte install/updating https://github.com/ltdrdata/ComfyUI-Manager/issues/1168
This commit is contained in:
parent
1579c58876
commit
fa1b514440
@ -31,8 +31,7 @@ if comfy_path is None:
|
||||
except:
|
||||
print("\n[bold yellow]WARN: The `COMFYUI_PATH` environment variable is not set. Assuming `custom_nodes/ComfyUI-Manager/../../` as the ComfyUI path.[/bold yellow]", file=sys.stderr)
|
||||
comfy_path = os.path.abspath(os.path.join(manager_util.comfyui_manager_path, '..', '..'))
|
||||
|
||||
sys.path.append(comfy_path)
|
||||
sys.path.append(comfy_path)
|
||||
|
||||
import utils.extra_config
|
||||
import cm_global
|
||||
|
||||
@ -14202,17 +14202,6 @@
|
||||
"install_type": "git-clone",
|
||||
"description": "multiline text node that strips c-style comments (i.e.'//' and '/* ... */') before passing output string downstream"
|
||||
},
|
||||
{
|
||||
"author": "noarche",
|
||||
"title": "noarche/Color Enhance",
|
||||
"id": "color-enhance",
|
||||
"reference": "https://github.com/noarche/sd-webui-color-enhance",
|
||||
"files": [
|
||||
"https://github.com/noarche/sd-webui-color-enhance"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "Script for [a/AUTOMATIC1111/stable-diffusion-webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui) and node for ComfyUI to enhance colors.\nThis is the same algorithm GIMP/GEGL uses for color enhancement. The gist of this implementation is that it converts the color space to [CIELCh(ab) and normalizes the chroma (or '[a/colorfulness](https://en.wikipedia.org/wiki/Colorfulness)') component. Original source can be found in the link below."
|
||||
},
|
||||
{
|
||||
"author": "emojiiii",
|
||||
"title": "ComfyUI_Emojiiii_Custom_Nodes",
|
||||
|
||||
@ -42,7 +42,7 @@ import manager_downloader
|
||||
from node_package import InstalledNodePackage
|
||||
|
||||
|
||||
version_code = [3, 21, 5]
|
||||
version_code = [3, 22]
|
||||
version_str = f"V{version_code[0]}.{version_code[1]}" + (f'.{version_code[2]}' if len(version_code) > 2 else '')
|
||||
|
||||
|
||||
@ -345,6 +345,7 @@ class ManagedResult:
|
||||
self.msg = None
|
||||
self.target = None
|
||||
self.postinstall = lambda: True
|
||||
self.ver = None
|
||||
|
||||
def append(self, item):
|
||||
self.items.append(item)
|
||||
@ -366,6 +367,10 @@ class ManagedResult:
|
||||
self.postinstall = postinstall
|
||||
return self
|
||||
|
||||
def with_ver(self, ver):
|
||||
self.ver = ver
|
||||
return self
|
||||
|
||||
|
||||
class UnifiedManager:
|
||||
def __init__(self):
|
||||
@ -789,6 +794,7 @@ class UnifiedManager:
|
||||
node_id = v['id']
|
||||
else:
|
||||
node_id = v['files'][0].split('/')[-1]
|
||||
v['repository'] = v['files'][0]
|
||||
res[node_id] = v
|
||||
elif len(v['files']) > 1:
|
||||
res[v['files'][0]] = v # A custom node composed of multiple url is treated as a single repository with one representative path
|
||||
@ -1334,14 +1340,14 @@ class UnifiedManager:
|
||||
version_spec = self.resolve_unspecified_version(node_id, guess_mode='active')
|
||||
|
||||
if version_spec is None:
|
||||
return ManagedResult('update').fail(f'Update not available: {node_id}@{version_spec}')
|
||||
return ManagedResult('update').fail(f'Update not available: {node_id}@{version_spec}').with_ver(version_spec)
|
||||
|
||||
if version_spec == 'nightly':
|
||||
return self.repo_update(self.active_nodes[node_id][1], instant_execution=instant_execution, no_deps=no_deps, return_postinstall=return_postinstall).with_target('nightly')
|
||||
return self.repo_update(self.active_nodes[node_id][1], instant_execution=instant_execution, no_deps=no_deps, return_postinstall=return_postinstall).with_target('nightly').with_ver('nightly')
|
||||
elif version_spec == 'unknown':
|
||||
return self.repo_update(self.unknown_active_nodes[node_id][1], instant_execution=instant_execution, no_deps=no_deps, return_postinstall=return_postinstall).with_target('unknown')
|
||||
return self.repo_update(self.unknown_active_nodes[node_id][1], instant_execution=instant_execution, no_deps=no_deps, return_postinstall=return_postinstall).with_target('unknown').with_ver('unknown')
|
||||
else:
|
||||
return self.cnr_switch_version(node_id, instant_execution=instant_execution, no_deps=no_deps, return_postinstall=return_postinstall)
|
||||
return self.cnr_switch_version(node_id, instant_execution=instant_execution, no_deps=no_deps, return_postinstall=return_postinstall).with_ver('cnr')
|
||||
|
||||
async def install_by_id(self, node_id, version_spec=None, channel=None, mode=None, instant_execution=False, no_deps=False, return_postinstall=False):
|
||||
"""
|
||||
|
||||
@ -416,25 +416,41 @@ async def task_worker():
|
||||
traceback.print_exc()
|
||||
return f"Installation failed:\n{node_spec_str}"
|
||||
|
||||
async def do_update(item) -> str:
|
||||
async def do_update(item):
|
||||
ui_id, node_name, node_ver = item
|
||||
|
||||
try:
|
||||
res = core.unified_manager.unified_update(node_name, node_ver)
|
||||
|
||||
if res.ver == 'unknown':
|
||||
url = core.unified_manager.unknown_active_nodes[node_name][0]
|
||||
title = os.path.basename(url)
|
||||
else:
|
||||
url = core.unified_manager.cnr_map[node_name].get('repository')
|
||||
title = core.unified_manager.cnr_map[node_name]['name']
|
||||
|
||||
manager_util.clear_pip_cache()
|
||||
|
||||
if url is not None:
|
||||
base_res = {'url': url, 'title': title}
|
||||
else:
|
||||
base_res = {'title': title}
|
||||
|
||||
if res.result:
|
||||
if res.action == 'skip':
|
||||
return 'skip'
|
||||
base_res['msg'] = 'skip'
|
||||
return base_res
|
||||
else:
|
||||
return 'success'
|
||||
base_res['msg'] = 'success'
|
||||
return base_res
|
||||
|
||||
base_res['msg'] = f"An error occurred while updating '{node_name}'."
|
||||
logging.error(f"\nERROR: An error occurred while updating '{node_name}'.")
|
||||
return base_res
|
||||
except Exception:
|
||||
traceback.print_exc()
|
||||
|
||||
return f"An error occurred while updating '{node_name}'."
|
||||
return {'msg':f"An error occurred while updating '{node_name}'."}
|
||||
|
||||
async def do_update_comfyui() -> str:
|
||||
try:
|
||||
@ -607,6 +623,9 @@ async def task_worker():
|
||||
elif kind == 'update-comfyui':
|
||||
nodepack_result['comfyui'] = msg
|
||||
ui_target = "main"
|
||||
elif kind == 'update':
|
||||
nodepack_result[ui_id] = msg['msg']
|
||||
ui_target = "nodepack_manager"
|
||||
else:
|
||||
nodepack_result[ui_id] = msg
|
||||
ui_target = "nodepack_manager"
|
||||
@ -711,6 +730,15 @@ async def update_all(request):
|
||||
update_item = k, k, v[0]
|
||||
task_queue.put(("update-main", update_item))
|
||||
|
||||
for k, v in core.unified_manager.unknown_active_nodes.items():
|
||||
if k == 'comfyui-manager':
|
||||
# skip updating comfyui-manager if desktop version
|
||||
if os.environ.get('__COMFYUI_DESKTOP_VERSION__'):
|
||||
continue
|
||||
|
||||
update_item = k, k, 'unknown'
|
||||
task_queue.put(("update-main", update_item))
|
||||
|
||||
return web.Response(status=200)
|
||||
|
||||
|
||||
|
||||
@ -707,17 +707,15 @@ async function onQueueStatus(event) {
|
||||
for(let k in event.detail.nodepack_result){
|
||||
let v = event.detail.nodepack_result[k];
|
||||
|
||||
if(v == 'success') {
|
||||
if(k == 'comfyui')
|
||||
comfyui_state = 'success';
|
||||
else
|
||||
success_list.push(k);
|
||||
if(k == 'comfyui') {
|
||||
comfyui_state = v;
|
||||
continue;
|
||||
}
|
||||
else if(v == 'skip') {
|
||||
if(k == 'comfyui')
|
||||
comfyui_state = 'skip';
|
||||
|
||||
if(v.msg == 'success') {
|
||||
success_list.push(k);
|
||||
}
|
||||
else
|
||||
else if(v.msg != 'skip')
|
||||
failed_list.push(k);
|
||||
}
|
||||
|
||||
@ -737,14 +735,22 @@ async function onQueueStatus(event) {
|
||||
else if(comfyui_state == 'skip') {
|
||||
msg += "ComfyUI is already up-to-date.<BR><BR>"
|
||||
}
|
||||
else if(comfyui_state != null) {
|
||||
msg += "Failed to update ComfyUI.<BR><BR>"
|
||||
}
|
||||
|
||||
if(success_list.length > 0) {
|
||||
msg += "The following custom nodes have been updated:<ul>";
|
||||
for(let x in success_list) {
|
||||
if(success_list[x] == 'comfyui')
|
||||
continue;
|
||||
|
||||
msg += '<li>'+success_list[x]+'</li>';
|
||||
let k = success_list[x];
|
||||
let url = event.detail.nodepack_result[k].url;
|
||||
let title = event.detail.nodepack_result[k].title;
|
||||
if(url) {
|
||||
msg += `<li><a href='${url}' target='_blank'>${title}</a></li>`;
|
||||
}
|
||||
else {
|
||||
msg += `<li>${k}</li>`;
|
||||
}
|
||||
}
|
||||
msg += "</ul>";
|
||||
}
|
||||
@ -755,7 +761,15 @@ async function onQueueStatus(event) {
|
||||
if(failed_list.length > 0) {
|
||||
msg += '<br>The update for the following custom nodes has failed:<ul>';
|
||||
for(let x in failed_list) {
|
||||
msg += '<li>'+failed_list[x]+'</li>';
|
||||
let k = failed_list[x];
|
||||
let url = event.detail.nodepack_result[k].url;
|
||||
let title = event.detail.nodepack_result[k].title;
|
||||
if(url) {
|
||||
msg += `<li><a href='${url}' target='_blank'>${title}</a></li>`;
|
||||
}
|
||||
else {
|
||||
msg += `<li>${k}</li>`;
|
||||
}
|
||||
}
|
||||
|
||||
msg += '</ul>'
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
[project]
|
||||
name = "comfyui-manager"
|
||||
description = "ComfyUI-Manager provides features to install and manage custom nodes for ComfyUI, as well as various functionalities to assist with ComfyUI."
|
||||
version = "3.21.5"
|
||||
version = "3.22"
|
||||
license = { file = "LICENSE.txt" }
|
||||
dependencies = ["GitPython", "PyGithub", "matrix-client==0.4.0", "transformers", "huggingface-hub>0.20", "typer", "rich", "typing-extensions"]
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user