Skip to content

Commit 7e51286

Browse files
committed
Merge branch 'main' into draft-v4
2 parents 3870abf + 1246538 commit 7e51286

File tree

10 files changed

+6998
-4891
lines changed

10 files changed

+6998
-4891
lines changed

comfyui_manager/glob/manager_core.py

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -304,18 +304,46 @@ def with_ver(self, ver):
304304
return self
305305

306306

307+
class NormalizedKeyDict(dict):
308+
def _normalize_key(self, key):
309+
if isinstance(key, str):
310+
return key.strip().lower()
311+
return key
312+
313+
def __setitem__(self, key, value):
314+
super().__setitem__(self._normalize_key(key), value)
315+
316+
def __getitem__(self, key):
317+
return super().__getitem__(self._normalize_key(key))
318+
319+
def __delitem__(self, key):
320+
return super().__delitem__(self._normalize_key(key))
321+
322+
def __contains__(self, key):
323+
return super().__contains__(self._normalize_key(key))
324+
325+
def get(self, key, default=None):
326+
return super().get(self._normalize_key(key), default)
327+
328+
def setdefault(self, key, default=None):
329+
return super().setdefault(self._normalize_key(key), default)
330+
331+
def pop(self, key, default=None):
332+
return super().pop(self._normalize_key(key), default)
333+
334+
307335
class UnifiedManager:
308336
def __init__(self):
309337
self.installed_node_packages: dict[str, InstalledNodePackage] = {}
310338

311-
self.cnr_inactive_nodes = {} # node_id -> node_version -> fullpath
312-
self.nightly_inactive_nodes = {} # node_id -> fullpath
313-
self.unknown_inactive_nodes = {} # node_id -> repo url * fullpath
314-
self.active_nodes = {} # node_id -> node_version * fullpath
315-
self.unknown_active_nodes = {} # node_id -> repo url * fullpath
316-
self.cnr_map = {} # node_id -> cnr info
317-
self.repo_cnr_map = {} # repo_url -> cnr info
318-
self.custom_node_map_cache = {} # (channel, mode) -> augmented custom node list json
339+
self.cnr_inactive_nodes = NormalizedKeyDict() # node_id -> node_version -> fullpath
340+
self.nightly_inactive_nodes = NormalizedKeyDict() # node_id -> fullpath
341+
self.unknown_inactive_nodes = {} # node_id -> repo url * fullpath
342+
self.active_nodes = NormalizedKeyDict() # node_id -> node_version * fullpath
343+
self.unknown_active_nodes = {} # node_id -> repo url * fullpath
344+
self.cnr_map = NormalizedKeyDict() # node_id -> cnr info
345+
self.repo_cnr_map = {} # repo_url -> cnr info
346+
self.custom_node_map_cache = {} # (channel, mode) -> augmented custom node list json
319347
self.processed_install = set()
320348

321349
def get_module_name(self, x):
@@ -2791,7 +2819,7 @@ async def get_unified_total_nodes(channel, mode, regsitry_cache_mode='cache'):
27912819

27922820
if cnr_id is not None:
27932821
# cnr or nightly version
2794-
cnr_ids.remove(cnr_id)
2822+
cnr_ids.discard(cnr_id)
27952823
updatable = False
27962824
cnr = unified_manager.cnr_map[cnr_id]
27972825

custom-node-list.json

Lines changed: 503 additions & 36 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)