publish diffutoon node

This commit is contained in:
AIFSH
2024-06-27 06:13:37 +08:00
parent bce34be99e
commit 7d5f08adda
6 changed files with 494 additions and 28 deletions
+4 -2
View File
@@ -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":
+1 -1
View File
@@ -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):