Spaces:
Runtime error
Runtime error
ChenyangSi
commited on
Commit
·
6d11fe7
1
Parent(s):
ff69ab2
Update app.py
Browse files
app.py
CHANGED
@@ -19,7 +19,10 @@ model_id = "CompVis/stable-diffusion-v1-4"
|
|
19 |
# register_free_crossattn_upblock2d(pip_freeu, b1=1.2, b2=1.4, s1=0.9, s2=0.2)
|
20 |
# # -------- freeu block registration
|
21 |
|
22 |
-
def infer(prompt,
|
|
|
|
|
|
|
23 |
|
24 |
|
25 |
# register_free_upblock2d(pip, b1=1.0, b2=1.0, s1=1.0, s2=1.0)
|
@@ -116,8 +119,8 @@ with block:
|
|
116 |
else:
|
117 |
model_id = "CompVis/stable-diffusion-v1-4"
|
118 |
|
119 |
-
pip = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
|
120 |
-
pip = pip.to("cuda")
|
121 |
|
122 |
with gr.Row():
|
123 |
with gr.Column():
|
@@ -178,11 +181,11 @@ with block:
|
|
178 |
image_2_label = gr.Markdown("FreeU")
|
179 |
|
180 |
|
181 |
-
ex = gr.Examples(examples=examples, fn=infer, inputs=[text,
|
182 |
ex.dataset.headers = [""]
|
183 |
|
184 |
-
text.submit(infer, inputs=[text,
|
185 |
-
btn.click(infer, inputs=[text,
|
186 |
|
187 |
block.launch()
|
188 |
# block.queue(default_enabled=False).launch(share=False)
|
|
|
19 |
# register_free_crossattn_upblock2d(pip_freeu, b1=1.2, b2=1.4, s1=0.9, s2=0.2)
|
20 |
# # -------- freeu block registration
|
21 |
|
22 |
+
def infer(prompt, model_id, seed, b1, b2, s1, s2):
|
23 |
+
|
24 |
+
pip = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
|
25 |
+
pip = pip.to("cuda")
|
26 |
|
27 |
|
28 |
# register_free_upblock2d(pip, b1=1.0, b2=1.0, s1=1.0, s2=1.0)
|
|
|
119 |
else:
|
120 |
model_id = "CompVis/stable-diffusion-v1-4"
|
121 |
|
122 |
+
# pip = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
|
123 |
+
# pip = pip.to("cuda")
|
124 |
|
125 |
with gr.Row():
|
126 |
with gr.Column():
|
|
|
181 |
image_2_label = gr.Markdown("FreeU")
|
182 |
|
183 |
|
184 |
+
ex = gr.Examples(examples=examples, fn=infer, inputs=[text, model_id, 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_id, seed, b1, b2, s1, s2], outputs=[image_1, image_2])
|
188 |
+
btn.click(infer, inputs=[text, model_id, seed, b1, b2, s1, s2], outputs=[image_1, image_2])
|
189 |
|
190 |
block.launch()
|
191 |
# block.queue(default_enabled=False).launch(share=False)
|