Commit
·
3df17a8
1
Parent(s):
54e5951
28. Sept. 2024, 19:04
Browse files
app.py
CHANGED
@@ -33,7 +33,10 @@ title = "ControlNet v1.1 Preprocessors Standalone"
|
|
33 |
model_canny = None
|
34 |
|
35 |
|
36 |
-
def canny(img, res, l, h):
|
|
|
|
|
|
|
37 |
img = resize_image(HWC3(img), res)
|
38 |
global model_canny
|
39 |
if model_canny is None:
|
@@ -41,7 +44,11 @@ def canny(img, res, l, h):
|
|
41 |
|
42 |
model_canny = CannyDetector()
|
43 |
result = model_canny(img, l, h)
|
44 |
-
|
|
|
|
|
|
|
|
|
45 |
|
46 |
|
47 |
# Hed
|
|
|
33 |
model_canny = None
|
34 |
|
35 |
|
36 |
+
def canny(img, res, l, h, old_images=None):
|
37 |
+
print("Old Images: ", old_images)
|
38 |
+
result_images = []
|
39 |
+
result = None
|
40 |
img = resize_image(HWC3(img), res)
|
41 |
global model_canny
|
42 |
if model_canny is None:
|
|
|
44 |
|
45 |
model_canny = CannyDetector()
|
46 |
result = model_canny(img, l, h)
|
47 |
+
result_images.append(result)
|
48 |
+
|
49 |
+
if old_images is not None:
|
50 |
+
result_images.extend(old_images)
|
51 |
+
return result_images
|
52 |
|
53 |
|
54 |
# Hed
|