From 6f8e766509c0c44ae2e04a79ab05a06e4467b51b Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Mon, 10 Mar 2025 03:33:17 -0400 Subject: [PATCH] Prevent custom nodes from accidentally overwriting global modules. --- nodes.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nodes.py b/nodes.py index bbf49915c..43697a24d 100644 --- a/nodes.py +++ b/nodes.py @@ -2129,10 +2129,12 @@ def get_module_name(module_path: str) -> str: def load_custom_node(module_path: str, ignore=set(), module_parent="custom_nodes") -> bool: - module_name = os.path.basename(module_path) if os.path.isfile(module_path): sp = os.path.splitext(module_path) module_name = sp[0] + elif os.path.isdir(module_path): + module_name = module_path + try: logging.debug("Trying to load custom node {}".format(module_path)) if os.path.isfile(module_path):