Spaces:
Runtime error
Runtime error
hadisalman
commited on
Commit
•
adc362f
1
Parent(s):
f593a12
Set cache_examples=False (weird behavior with ImaegMask component)
Browse files
app.py
CHANGED
@@ -85,7 +85,7 @@ def run(image, prompt, seed, immunize=False):
|
|
85 |
|
86 |
init_image = Image.fromarray(image['image'])
|
87 |
init_image = resize_and_crop(init_image, (512,512))
|
88 |
-
mask_image = ImageOps.invert(Image.fromarray(image['mask']).convert('RGB'))
|
89 |
mask_image = resize_and_crop(mask_image, init_image.size)
|
90 |
|
91 |
if immunize:
|
@@ -116,6 +116,7 @@ demo = gr.Interface(fn=run,
|
|
116 |
gr.Textbox(label='Seed', placeholder='1234'),
|
117 |
gr.Checkbox(label='Immunize', value=False),
|
118 |
],
|
|
|
119 |
outputs=[gr.Gallery(
|
120 |
label="Generated images",
|
121 |
show_label=False,
|
@@ -154,4 +155,4 @@ demo = gr.Interface(fn=run,
|
|
154 |
)
|
155 |
|
156 |
demo.launch()
|
157 |
-
# demo.launch(server_name='0.0.0.0', share=False, server_port=7860, inline=False
|
|
|
85 |
|
86 |
init_image = Image.fromarray(image['image'])
|
87 |
init_image = resize_and_crop(init_image, (512,512))
|
88 |
+
mask_image = ImageOps.invert(Image.fromarray(image['mask']).convert('RGB'))
|
89 |
mask_image = resize_and_crop(mask_image, init_image.size)
|
90 |
|
91 |
if immunize:
|
|
|
116 |
gr.Textbox(label='Seed', placeholder='1234'),
|
117 |
gr.Checkbox(label='Immunize', value=False),
|
118 |
],
|
119 |
+
cache_examples=False,
|
120 |
outputs=[gr.Gallery(
|
121 |
label="Generated images",
|
122 |
show_label=False,
|
|
|
155 |
)
|
156 |
|
157 |
demo.launch()
|
158 |
+
# demo.launch(server_name='0.0.0.0', share=False, server_port=7860, inline=False)
|