Update app.py
Browse files
app.py
CHANGED
|
@@ -2,7 +2,7 @@ import gradio as gr
|
|
| 2 |
import numpy as np
|
| 3 |
import random
|
| 4 |
import cv2
|
| 5 |
-
|
| 6 |
from controlnet_aux import OpenposeDetector
|
| 7 |
|
| 8 |
#import spaces #[uncomment to use ZeroGPU]
|
|
@@ -41,7 +41,7 @@ def get_canny_image(image):
|
|
| 41 |
image = cv2.Canny(image, low_threshold, high_threshold)
|
| 42 |
image = image[:, :, None]
|
| 43 |
image = np.concatenate([image, image, image], axis=2)
|
| 44 |
-
return Image.fromarray(image)
|
| 45 |
|
| 46 |
|
| 47 |
def get_openpos_image(image):
|
|
@@ -322,7 +322,7 @@ with gr.Blocks(css=css) as demo:
|
|
| 322 |
# ip_adapter_image,
|
| 323 |
# ip_adapter_scale,
|
| 324 |
],
|
| 325 |
-
outputs=[seed],
|
| 326 |
)
|
| 327 |
|
| 328 |
|
|
|
|
| 2 |
import numpy as np
|
| 3 |
import random
|
| 4 |
import cv2
|
| 5 |
+
import PIL
|
| 6 |
from controlnet_aux import OpenposeDetector
|
| 7 |
|
| 8 |
#import spaces #[uncomment to use ZeroGPU]
|
|
|
|
| 41 |
image = cv2.Canny(image, low_threshold, high_threshold)
|
| 42 |
image = image[:, :, None]
|
| 43 |
image = np.concatenate([image, image, image], axis=2)
|
| 44 |
+
return PIL.Image.fromarray(image)
|
| 45 |
|
| 46 |
|
| 47 |
def get_openpos_image(image):
|
|
|
|
| 322 |
# ip_adapter_image,
|
| 323 |
# ip_adapter_scale,
|
| 324 |
],
|
| 325 |
+
outputs=[result, seed],
|
| 326 |
)
|
| 327 |
|
| 328 |
|