Spaces:
Runtime error
Runtime error
Commit
·
4fbcfd3
1
Parent(s):
6d11fe7
Update app.py
Browse files
app.py
CHANGED
|
@@ -113,11 +113,11 @@ with block:
|
|
| 113 |
sd_options = gr.Dropdown(['SD1.4', 'SD1.5', 'SD2.1'], value='SD1.4', label="SD options")
|
| 114 |
|
| 115 |
if sd_options == 'SD1.5':
|
| 116 |
-
|
| 117 |
elif sd_options == 'SD2.1':
|
| 118 |
-
|
| 119 |
else:
|
| 120 |
-
|
| 121 |
|
| 122 |
# pip = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
|
| 123 |
# pip = pip.to("cuda")
|
|
@@ -181,11 +181,11 @@ with block:
|
|
| 181 |
image_2_label = gr.Markdown("FreeU")
|
| 182 |
|
| 183 |
|
| 184 |
-
ex = gr.Examples(examples=examples, fn=infer, inputs=[text,
|
| 185 |
ex.dataset.headers = [""]
|
| 186 |
|
| 187 |
-
text.submit(infer, inputs=[text,
|
| 188 |
-
btn.click(infer, inputs=[text,
|
| 189 |
|
| 190 |
block.launch()
|
| 191 |
# block.queue(default_enabled=False).launch(share=False)
|
|
|
|
| 113 |
sd_options = gr.Dropdown(['SD1.4', 'SD1.5', 'SD2.1'], value='SD1.4', label="SD options")
|
| 114 |
|
| 115 |
if sd_options == 'SD1.5':
|
| 116 |
+
model = "runwayml/stable-diffusion-v1-5"
|
| 117 |
elif sd_options == 'SD2.1':
|
| 118 |
+
model = "stabilityai/stable-diffusion-2-1"
|
| 119 |
else:
|
| 120 |
+
model = "CompVis/stable-diffusion-v1-4"
|
| 121 |
|
| 122 |
# pip = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
|
| 123 |
# pip = pip.to("cuda")
|
|
|
|
| 181 |
image_2_label = gr.Markdown("FreeU")
|
| 182 |
|
| 183 |
|
| 184 |
+
ex = gr.Examples(examples=examples, fn=infer, inputs=[text, model, seed, b1, b2, s1, s2], outputs=[image_1, image_2], cache_examples=False)
|
| 185 |
ex.dataset.headers = [""]
|
| 186 |
|
| 187 |
+
text.submit(infer, inputs=[text, model, seed, b1, b2, s1, s2], outputs=[image_1, image_2])
|
| 188 |
+
btn.click(infer, inputs=[text, model, seed, b1, b2, s1, s2], outputs=[image_1, image_2])
|
| 189 |
|
| 190 |
block.launch()
|
| 191 |
# block.queue(default_enabled=False).launch(share=False)
|