Spaces:
Runtime error
Runtime error
Commit
·
550b4ef
1
Parent(s):
620f5cb
move image storage inside function scope
Browse files
app.py
CHANGED
@@ -19,14 +19,6 @@ import os
|
|
19 |
# 2. Sketch the mask (image->[image,mask]
|
20 |
# 3. Sketch the content of the mask
|
21 |
|
22 |
-
# Global Storage
|
23 |
-
CURRENT_IMAGE={'image' : None,
|
24 |
-
'mask' : None,
|
25 |
-
'guide' : None
|
26 |
-
}
|
27 |
-
|
28 |
-
HEIGHT,WIDTH=512,512
|
29 |
-
|
30 |
## SETUP PIPE
|
31 |
|
32 |
from diffusers import StableDiffusionInpaintPipeline, ControlNetModel, UniPCMultistepScheduler
|
@@ -62,20 +54,19 @@ css='''
|
|
62 |
.image_upload [data-testid="sketch"], .image_upload [data-testid="sketch"] > div{min-height: 500px}
|
63 |
.image_upload .touch-none{display: flex}
|
64 |
#output_image{min-height:500px;max-height=500px;}
|
65 |
-
@keyframes spin {
|
66 |
-
from {
|
67 |
-
transform: rotate(0deg);
|
68 |
-
}
|
69 |
-
to {
|
70 |
-
transform: rotate(360deg);
|
71 |
-
}
|
72 |
-
}
|
73 |
'''
|
74 |
|
75 |
def get_guide(image):
|
76 |
return hed(image,scribble=True)
|
77 |
|
78 |
-
def create_demo(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
with gr.Blocks(theme=gr.themes.Default(font=[gr.themes.GoogleFont("IBM Plex Mono"), "ui-monospace","monospace"],
|
80 |
primary_hue="lime",
|
81 |
secondary_hue="emerald",
|
|
|
19 |
# 2. Sketch the mask (image->[image,mask]
|
20 |
# 3. Sketch the content of the mask
|
21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
## SETUP PIPE
|
23 |
|
24 |
from diffusers import StableDiffusionInpaintPipeline, ControlNetModel, UniPCMultistepScheduler
|
|
|
54 |
.image_upload [data-testid="sketch"], .image_upload [data-testid="sketch"] > div{min-height: 500px}
|
55 |
.image_upload .touch-none{display: flex}
|
56 |
#output_image{min-height:500px;max-height=500px;}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
'''
|
58 |
|
59 |
def get_guide(image):
|
60 |
return hed(image,scribble=True)
|
61 |
|
62 |
+
def create_demo():
|
63 |
+
# Global Storage
|
64 |
+
CURRENT_IMAGE={'image': None,
|
65 |
+
'mask': None,
|
66 |
+
'guide': None
|
67 |
+
}
|
68 |
+
HEIGHT, WIDTH=512,512
|
69 |
+
|
70 |
with gr.Blocks(theme=gr.themes.Default(font=[gr.themes.GoogleFont("IBM Plex Mono"), "ui-monospace","monospace"],
|
71 |
primary_hue="lime",
|
72 |
secondary_hue="emerald",
|