diff --git a/glob/cm_global.py b/glob/cm_global.py
index 4041bcb6..118d475b 100644
--- a/glob/cm_global.py
+++ b/glob/cm_global.py
@@ -110,3 +110,6 @@ def add_on_revision_detected(k, f):
traceback.print_exc()
else:
variables['cm.on_revision_detected_handler'].append((k, f))
+
+
+error_dict = {}
\ No newline at end of file
diff --git a/glob/manager_core.py b/glob/manager_core.py
index fa780ee9..220ea9bb 100644
--- a/glob/manager_core.py
+++ b/glob/manager_core.py
@@ -41,7 +41,7 @@ import manager_downloader
from node_package import InstalledNodePackage
-version_code = [3, 7, 6]
+version_code = [3, 8]
version_str = f"V{version_code[0]}.{version_code[1]}" + (f'.{version_code[2]}' if len(version_code) > 2 else '')
@@ -122,7 +122,6 @@ def check_invalid_nodes():
if subdir in ['.disabled', '__pycache__']:
continue
-
package = unified_manager.installed_node_packages.get(subdir)
if not package:
continue
@@ -368,6 +367,16 @@ class UnifiedManager:
self.custom_node_map_cache = {} # (channel, mode) -> augmented custom node list json
self.processed_install = set()
+ def get_module_name(self, x):
+ info = self.active_nodes.get(x)
+ if info is None:
+ for url, fullpath in self.unknown_active_nodes.values():
+ if url == x:
+ return os.path.basename(fullpath)
+ else:
+ return os.path.basename(info[1])
+
+ return None
def get_cnr_by_repo(self, url):
return self.repo_cnr_map.get(git_utils.normalize_url(url))
@@ -501,8 +510,8 @@ class UnifiedManager:
self.installed_node_packages[node_package.id] = node_package
if node_package.is_disabled and node_package.is_unknown:
- # NOTE: unknown package does not have an url.
- self.unknown_inactive_nodes[node_package.id] = ('', node_package.fullpath)
+ url = git_utils.git_url(node_package.fullpath)
+ self.unknown_inactive_nodes[node_package.id] = (url, node_package.fullpath)
if node_package.is_disabled and node_package.is_nightly:
self.nightly_inactive_nodes[node_package.id] = node_package.fullpath
@@ -511,8 +520,8 @@ class UnifiedManager:
self.active_nodes[node_package.id] = node_package.version, node_package.fullpath
if node_package.is_enabled and node_package.is_unknown:
- # NOTE: unknown package does not have an url.
- self.unknown_active_nodes[node_package.id] = ('', node_package.fullpath)
+ url = git_utils.git_url(node_package.fullpath)
+ self.unknown_active_nodes[node_package.id] = (url, node_package.fullpath)
if node_package.is_from_cnr and node_package.is_disabled:
self.add_to_cnr_inactive_nodes(node_package.id, node_package.version, node_package.fullpath)
@@ -726,7 +735,6 @@ class UnifiedManager:
# default_channel = normalize_channel('default')
# cache = self.custom_node_map_cache.get((default_channel, mode)) # CNR/nightly should always be based on the default channel.
-
channel = normalize_channel(channel)
cache = self.custom_node_map_cache.get((channel, mode)) # CNR/nightly should always be based on the default channel.
diff --git a/glob/manager_server.py b/glob/manager_server.py
index ef625242..99b36e5d 100644
--- a/glob/manager_server.py
+++ b/glob/manager_server.py
@@ -839,6 +839,23 @@ async def get_disabled_versions(request):
return web.Response(status=400)
+@routes.post("/customnode/import_fail_info")
+async def import_fail_info(request):
+ json_data = await request.json()
+
+ if 'cnr_id' in json_data:
+ module_name = core.unified_manager.get_module_name(json_data['cnr_id'])
+ else:
+ module_name = core.unified_manager.get_module_name(json_data['url'])
+
+ if module_name is not None:
+ info = cm_global.error_dict.get(module_name)
+ if info is not None:
+ return web.json_response(info)
+
+ return web.Response(status=400)
+
+
@routes.post("/customnode/reinstall")
async def reinstall_custom_node(request):
await uninstall_custom_node(request)
@@ -1437,3 +1454,4 @@ cm_global.register_extension('ComfyUI-Manager',
'nodes': {},
'description': 'This extension provides the ability to manage custom nodes in ComfyUI.', })
+
diff --git a/glob/manager_util.py b/glob/manager_util.py
index 0cfa8da8..7ab6b625 100644
--- a/glob/manager_util.py
+++ b/glob/manager_util.py
@@ -125,7 +125,7 @@ async def get_data(uri, silent=False):
json_obj = json.loads(json_text)
if not silent:
- logging.info(" [DONE]")
+ print(" [DONE]")
return json_obj
diff --git a/js/common.js b/js/common.js
index ace1885a..2597ea66 100644
--- a/js/common.js
+++ b/js/common.js
@@ -397,3 +397,12 @@ export const icons = {
passed: '',
download: ''
}
+
+export function sanitizeHTML(str) {
+ return str
+ .replace(/&/g, "&")
+ .replace(//g, ">")
+ .replace(/"/g, """)
+ .replace(/'/g, "'");
+}
\ No newline at end of file
diff --git a/js/custom-nodes-manager.js b/js/custom-nodes-manager.js
index 7ad6e9b4..e147c34a 100644
--- a/js/custom-nodes-manager.js
+++ b/js/custom-nodes-manager.js
@@ -4,7 +4,7 @@ import { api } from "../../scripts/api.js";
import {
manager_instance, rebootAPI, install_via_git_url,
- fetchData, md5, icons, show_message, customConfirm, customAlert, customPrompt
+ fetchData, md5, icons, show_message, customConfirm, customAlert, customPrompt, sanitizeHTML
} from "./common.js";
// https://cenfun.github.io/turbogrid/api.html
@@ -250,6 +250,13 @@ const pageCss = `
color: white;
}
+.cn-manager .cn-btn-import-failed {
+ background-color: #AA1111;
+ font-size: 10px;
+ font-weight: bold;
+ color: white;
+}
+
.cn-manager .cn-btn-install {
background-color: black;
color: white;
@@ -872,6 +879,38 @@ export class CustomNodesManager {
return this.filter === ShowMode.ALTERNATIVES
}
+ async handleImportFail(rowItem) {
+ var info;
+ if(rowItem.version == 'unknown'){
+ info = {
+ 'url': rowItem.originalData.files[0]
+ };
+ }
+ else{
+ info = {
+ 'cnr_id': rowItem.originalData.id
+ };
+ }
+
+ const response = await api.fetchApi(`/customnode/import_fail_info`, {
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json' },
+ body: JSON.stringify(info)
+ });
+
+ let res = await response.json();
+
+ let title = `Error message occurred while importing the '${rowItem.title}' module.