Complete moving all preprocessor nodes to custom_nodes

This commit is contained in:
Hacker 17082006 2023-02-19 20:38:39 +07:00
parent c1ef4fff7d
commit e35f293621
2 changed files with 5 additions and 3 deletions

View File

@ -1,4 +1,4 @@
from custom_node_module.annotator import canny, hed, midas, mlsd, openpose, uniformer
from annotator import canny, hed, midas, mlsd, openpose, uniformer
from annotator.util import HWC3
import torch
import numpy as np
@ -116,7 +116,7 @@ class UniformerPreprocessor:
image = img_np_to_tensor(HWC3(image))
return (image,)
NODE_CLASS_MAPPING = {
NODE_CLASS_MAPPINGS = {
"CannyPreprocessor": CannyPreprocessor,
"HEDPreprocessor": HEDPreprocessor,
"DepthPreprocessor": MIDASPreprocessor,

View File

@ -753,7 +753,9 @@ def load_custom_nodes():
possible_modules = os.listdir(CUSTOM_NODE_PATH)
if "__pycache__" in possible_modules:
possible_modules.remove("__pycache__")
if ".ipynb_checkpoints" in possible_modules:
possible_modules.remove(".ipynb_checkpoints")
for possible_module in possible_modules:
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