From c1ef4fff7d310fd836418cda1ba33c1b85f9e1da Mon Sep 17 00:00:00 2001 From: Hacker 17082006 Date: Sun, 19 Feb 2023 20:08:16 +0700 Subject: [PATCH] Change module_name var in nodes.py since it can make local module import in module folder dont work --- custom_nodes/annotator/__init__.py | 4 ++-- nodes.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/custom_nodes/annotator/__init__.py b/custom_nodes/annotator/__init__.py index c08dd6e2d..1e97dde58 100644 --- a/custom_nodes/annotator/__init__.py +++ b/custom_nodes/annotator/__init__.py @@ -1,5 +1,5 @@ -import canny, hed, midas, mlsd, openpose, uniformer -from util import HWC3 +from custom_node_module.annotator import canny, hed, midas, mlsd, openpose, uniformer +from annotator.util import HWC3 import torch import numpy as np diff --git a/nodes.py b/nodes.py index bbf2c36fe..bca8dd5a4 100644 --- a/nodes.py +++ b/nodes.py @@ -758,7 +758,7 @@ def load_custom_nodes(): module_path = os.path.join(CUSTOM_NODE_PATH, possible_module) if os.path.isfile(module_path) and os.path.splitext(module_path)[1] != ".py": continue - module_name = "custom_node_module.{}".format(possible_module) + module_name = os.path.basename(module_path) try: if os.path.isfile(module_path): module_spec = importlib.util.spec_from_file_location(module_name, module_path)