kadirnar commited on
Commit
40108e7
1 Parent(s): bc439b3

Update diffusion_webui/utils/preprocces_utils.py

Browse files
diffusion_webui/utils/preprocces_utils.py CHANGED
@@ -17,25 +17,6 @@ from controlnet_aux import (
17
  import numpy as np
18
  import cv2
19
 
20
-
21
- PREPROCCES_DICT = {
22
- "Hed": HEDdetector.from_pretrained("lllyasviel/Annotators"),
23
- "Midas": MidasDetector.from_pretrained("lllyasviel/Annotators"),
24
- "MLSD": MLSDdetector.from_pretrained("lllyasviel/Annotators"),
25
- "Openpose": OpenposeDetector.from_pretrained("lllyasviel/Annotators"),
26
- "PidiNet": PidiNetDetector.from_pretrained("lllyasviel/Annotators"),
27
- "NormalBae": NormalBaeDetector.from_pretrained("lllyasviel/Annotators"),
28
- "Lineart": LineartDetector.from_pretrained("lllyasviel/Annotators"),
29
- "LineartAnime": LineartAnimeDetector.from_pretrained(
30
- "lllyasviel/Annotators"
31
- ),
32
- "Zoe": ZoeDetector.from_pretrained("lllyasviel/Annotators"),
33
- "Canny": CannyDetector(),
34
- "ContentShuffle": ContentShuffleDetector(),
35
- "MediapipeFace": MediapipeFaceDetector(),
36
- "ScribbleXDOG": scribble_xdog
37
- }
38
-
39
  def pad64(x):
40
  return int(np.ceil(float(x) / 64.0) * 64 - x)
41
 
@@ -90,4 +71,23 @@ def scribble_xdog(img, res=512, thr_a=32, **kwargs):
90
  result = np.zeros_like(img, dtype=np.uint8)
91
  result[2 * (255 - dog) > thr_a] = 255
92
  return remove_pad(result), True
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
 
 
17
  import numpy as np
18
  import cv2
19
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  def pad64(x):
21
  return int(np.ceil(float(x) / 64.0) * 64 - x)
22
 
 
71
  result = np.zeros_like(img, dtype=np.uint8)
72
  result[2 * (255 - dog) > thr_a] = 255
73
  return remove_pad(result), True
74
+
75
+
76
+ PREPROCCES_DICT = {
77
+ "Hed": HEDdetector.from_pretrained("lllyasviel/Annotators"),
78
+ "Midas": MidasDetector.from_pretrained("lllyasviel/Annotators"),
79
+ "MLSD": MLSDdetector.from_pretrained("lllyasviel/Annotators"),
80
+ "Openpose": OpenposeDetector.from_pretrained("lllyasviel/Annotators"),
81
+ "PidiNet": PidiNetDetector.from_pretrained("lllyasviel/Annotators"),
82
+ "NormalBae": NormalBaeDetector.from_pretrained("lllyasviel/Annotators"),
83
+ "Lineart": LineartDetector.from_pretrained("lllyasviel/Annotators"),
84
+ "LineartAnime": LineartAnimeDetector.from_pretrained(
85
+ "lllyasviel/Annotators"
86
+ ),
87
+ "Zoe": ZoeDetector.from_pretrained("lllyasviel/Annotators"),
88
+ "Canny": CannyDetector(),
89
+ "ContentShuffle": ContentShuffleDetector(),
90
+ "MediapipeFace": MediapipeFaceDetector(),
91
+ "ScribbleXDOG": scribble_xdog
92
+ }
93