Spaces:
Running
on
Zero
Running
on
Zero
ZeroGPU
Browse files
app.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
import torch
|
|
|
|
| 2 |
import gradio as gr
|
| 3 |
from diffusers import DiffusionPipeline
|
| 4 |
|
|
@@ -12,7 +13,7 @@ pipe = DiffusionPipeline.from_pretrained(
|
|
| 12 |
pipe.to("cuda")
|
| 13 |
print("Pipeline loaded!")
|
| 14 |
|
| 15 |
-
|
| 16 |
def generate_image(prompt, height, width, num_inference_steps, seed, randomize_seed):
|
| 17 |
"""Generate an image from the given prompt."""
|
| 18 |
if randomize_seed:
|
|
|
|
| 1 |
import torch
|
| 2 |
+
import spaces
|
| 3 |
import gradio as gr
|
| 4 |
from diffusers import DiffusionPipeline
|
| 5 |
|
|
|
|
| 13 |
pipe.to("cuda")
|
| 14 |
print("Pipeline loaded!")
|
| 15 |
|
| 16 |
+
@spaces.GPU
|
| 17 |
def generate_image(prompt, height, width, num_inference_steps, seed, randomize_seed):
|
| 18 |
"""Generate an image from the given prompt."""
|
| 19 |
if randomize_seed:
|