Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -40,6 +40,7 @@ import PIL.Image
|
|
| 40 |
import autocuda
|
| 41 |
import findfile
|
| 42 |
|
|
|
|
| 43 |
from diffusers import (
|
| 44 |
AutoencoderKL,
|
| 45 |
UNet2DConditionModel,
|
|
@@ -290,6 +291,7 @@ def on_model_change(model_name: str) -> Tuple[gr.update, gr.update]:
|
|
| 290 |
gr.update(placeholder=prefix_text),
|
| 291 |
)
|
| 292 |
|
|
|
|
| 293 |
def generate_image(
|
| 294 |
mode: str,
|
| 295 |
model_name: str,
|
|
|
|
| 40 |
import autocuda
|
| 41 |
import findfile
|
| 42 |
|
| 43 |
+
import spaces
|
| 44 |
from diffusers import (
|
| 45 |
AutoencoderKL,
|
| 46 |
UNet2DConditionModel,
|
|
|
|
| 291 |
gr.update(placeholder=prefix_text),
|
| 292 |
)
|
| 293 |
|
| 294 |
+
@spaces.GPU(duration=60)
|
| 295 |
def generate_image(
|
| 296 |
mode: str,
|
| 297 |
model_name: str,
|