Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -298,12 +298,13 @@ def stable_diffusion_compose(prompt, scale, steps):
|
|
298 |
|
299 |
|
300 |
def compose(prompt, version, guidance_scale, steps):
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
|
|
307 |
|
308 |
|
309 |
examples_1 = 'a camel | a forest'
|
@@ -332,7 +333,7 @@ iface = gr.Interface(compose,
|
|
332 |
inputs=[
|
333 |
"text",
|
334 |
gr.Radio(['Stable_Diffusion_1v_4', 'GLIDE', 'CLEVR Objects'], type="value", label='version'),
|
335 |
-
gr.Slider(2,
|
336 |
gr.Slider(10, 200)
|
337 |
],
|
338 |
outputs='image',
|
|
|
298 |
|
299 |
|
300 |
def compose(prompt, version, guidance_scale, steps):
|
301 |
+
with th.no_grad():
|
302 |
+
if version == 'GLIDE':
|
303 |
+
return compose_language_descriptions(prompt, guidance_scale, steps)
|
304 |
+
elif version == 'Stable_Diffusion_1v_4':
|
305 |
+
return stable_diffusion_compose(prompt, guidance_scale, steps)
|
306 |
+
else:
|
307 |
+
return compose_clevr_objects(prompt, guidance_scale, steps)
|
308 |
|
309 |
|
310 |
examples_1 = 'a camel | a forest'
|
|
|
333 |
inputs=[
|
334 |
"text",
|
335 |
gr.Radio(['Stable_Diffusion_1v_4', 'GLIDE', 'CLEVR Objects'], type="value", label='version'),
|
336 |
+
gr.Slider(2, 30),
|
337 |
gr.Slider(10, 200)
|
338 |
],
|
339 |
outputs='image',
|