Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -61,20 +61,23 @@ def run_schnell(prompt):
|
|
| 61 |
print("Ran!")
|
| 62 |
return image
|
| 63 |
|
|
|
|
| 64 |
def run_parallel_models(prompt):
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
|
|
|
|
|
|
| 78 |
|
| 79 |
with gr.Blocks() as demo:
|
| 80 |
gr.Markdown("# Low Step Flux Comparison")
|
|
|
|
| 61 |
print("Ran!")
|
| 62 |
return image
|
| 63 |
|
| 64 |
+
@spaces.GPU
|
| 65 |
def run_parallel_models(prompt):
|
| 66 |
+
pipe_dev.to("cuda")
|
| 67 |
+
pipe_dev.load_lora_weights(hyper_lora)
|
| 68 |
+
image = pipe_dev(prompt, num_inference_steps=8, joint_attention_kwargs={"scale": 0.125}).images[0]
|
| 69 |
+
pipe_dev.unload_lora_weights()
|
| 70 |
+
yield image, gr.update(), gr.update()
|
| 71 |
+
pipe_dev.load_lora_weights(turbo_lora)
|
| 72 |
+
image = pipe_dev(prompt, num_inference_steps=8).images[0]
|
| 73 |
+
yield gr.update(), image, gr.update()
|
| 74 |
+
pipe_dev.unload_lora_weights()
|
| 75 |
+
pipe_dev.to("cpu")
|
| 76 |
+
pipe_schnell.to("cuda")
|
| 77 |
+
image = pipe_schnell(prompt, num_inference_steps=4).images[0]
|
| 78 |
+
yield gr.update(), gr.update(), image
|
| 79 |
+
|
| 80 |
+
#run_parallel_models.zerogpu = True
|
| 81 |
|
| 82 |
with gr.Blocks() as demo:
|
| 83 |
gr.Markdown("# Low Step Flux Comparison")
|