Change module_name var in nodes.py since it can make local module import in module folder dont work

This commit is contained in:
Hacker 17082006 2023-02-19 20:08:16 +07:00
parent 841345ce46
commit c1ef4fff7d
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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)