Maria
commited on
Commit
·
73270ee
1
Parent(s):
df64a69
hw6
Browse files
infer.py
CHANGED
@@ -137,6 +137,9 @@ def prepare_controlnet_image(controlnet_image, mode):
|
|
137 |
image = np.repeat(image[:, :, None], 3, axis=2)
|
138 |
image = Image.fromarray(image)
|
139 |
|
|
|
|
|
|
|
140 |
elif mode == "HED edge detection (soft edge)":
|
141 |
processor = HEDdetector.from_pretrained('lllyasviel/Annotators')
|
142 |
image = processor(controlnet_image)
|
|
|
137 |
image = np.repeat(image[:, :, None], 3, axis=2)
|
138 |
image = Image.fromarray(image)
|
139 |
|
140 |
+
elif mode == "Pixel to Pixel":
|
141 |
+
image = controlnet_image.convert('RGB')
|
142 |
+
|
143 |
elif mode == "HED edge detection (soft edge)":
|
144 |
processor = HEDdetector.from_pretrained('lllyasviel/Annotators')
|
145 |
image = processor(controlnet_image)
|