Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -27,6 +27,7 @@ low_threshold = 100
|
|
27 |
high_threshold = 200
|
28 |
|
29 |
def resize_image(image):
|
|
|
30 |
current_size = image.size
|
31 |
if current_size[0] > current_size[1]:
|
32 |
center_cropped_image = transforms.functional.center_crop(image, (current_size[1], current_size[1]))
|
@@ -52,7 +53,7 @@ def process(input_image, prompt, num_steps, controlnet_conditioning_scale):
|
|
52 |
|
53 |
canny_image = get_canny_filter(input_image)
|
54 |
images = pipe(
|
55 |
-
prompt,image=canny_image, num_inference_steps=num_steps, controlnet_conditioning_scale=controlnet_conditioning_scale,
|
56 |
).images
|
57 |
|
58 |
return [canny_image,images[0]]
|
|
|
27 |
high_threshold = 200
|
28 |
|
29 |
def resize_image(image):
|
30 |
+
image = image.convert('RGB')
|
31 |
current_size = image.size
|
32 |
if current_size[0] > current_size[1]:
|
33 |
center_cropped_image = transforms.functional.center_crop(image, (current_size[1], current_size[1]))
|
|
|
53 |
|
54 |
canny_image = get_canny_filter(input_image)
|
55 |
images = pipe(
|
56 |
+
prompt,image=canny_image, num_inference_steps=num_steps, controlnet_conditioning_scale=float(controlnet_conditioning_scale),
|
57 |
).images
|
58 |
|
59 |
return [canny_image,images[0]]
|