publish diffutoon node
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import os
|
||||
import folder_paths
|
||||
from typing_extensions import Literal, TypeAlias
|
||||
import warnings
|
||||
with warnings.catch_warnings():
|
||||
@@ -6,13 +8,13 @@ with warnings.catch_warnings():
|
||||
CannyDetector, MidasDetector, HEDdetector, LineartDetector, LineartAnimeDetector, OpenposeDetector
|
||||
)
|
||||
|
||||
|
||||
annotators_dir = os.path.join(folder_paths.models_dir, "Annotators")
|
||||
Processor_id: TypeAlias = Literal[
|
||||
"canny", "depth", "softedge", "lineart", "lineart_anime", "openpose", "tile"
|
||||
]
|
||||
|
||||
class Annotator:
|
||||
def __init__(self, processor_id: Processor_id, model_path="models/Annotators", detect_resolution=None):
|
||||
def __init__(self, processor_id: Processor_id, model_path=annotators_dir, detect_resolution=None):
|
||||
if processor_id == "canny":
|
||||
self.processor = CannyDetector()
|
||||
elif processor_id == "depth":
|
||||
|
||||
@@ -114,7 +114,7 @@ class VideoData:
|
||||
if self.height is not None and self.width is not None:
|
||||
return self.height, self.width
|
||||
else:
|
||||
height, width, _ = self.__getitem__(0).shape
|
||||
height, width = self.__getitem__(0).size
|
||||
return height, width
|
||||
|
||||
def __getitem__(self, item):
|
||||
|
||||
Reference in New Issue
Block a user