Spaces:
Running
on
Zero
Running
on
Zero
add duration
Browse files
app.py
CHANGED
|
@@ -297,9 +297,9 @@ def _encode_prompt(prompt: str):
|
|
| 297 |
# -----------------------------
|
| 298 |
# Inference functions
|
| 299 |
# -----------------------------
|
| 300 |
-
@spaces.GPU
|
| 301 |
@torch.no_grad()
|
| 302 |
-
def generate_image_stack_edits(text_prompt, n_edits, input_image):
|
| 303 |
"""
|
| 304 |
Compute n_edits images on a single GPU for slider values in (0,1],
|
| 305 |
return (list_of_images, first_image) so the UI shows immediately.
|
|
@@ -350,8 +350,8 @@ def generate_image_stack_edits(text_prompt, n_edits, input_image):
|
|
| 350 |
first = results[0] if results else None
|
| 351 |
return results, first
|
| 352 |
|
| 353 |
-
@spaces.GPU
|
| 354 |
-
def generate_single_image(text_prompt, slider_value, input_image):
|
| 355 |
if not input_image or not text_prompt or text_prompt.startswith("Please select"):
|
| 356 |
return None
|
| 357 |
|
|
|
|
| 297 |
# -----------------------------
|
| 298 |
# Inference functions
|
| 299 |
# -----------------------------
|
| 300 |
+
@spaces.GPU(duration=300)
|
| 301 |
@torch.no_grad()
|
| 302 |
+
def generate_image_stack_edits(text_prompt, n_edits, input_image, progress=gr.Progress(track_tqdm=True)):
|
| 303 |
"""
|
| 304 |
Compute n_edits images on a single GPU for slider values in (0,1],
|
| 305 |
return (list_of_images, first_image) so the UI shows immediately.
|
|
|
|
| 350 |
first = results[0] if results else None
|
| 351 |
return results, first
|
| 352 |
|
| 353 |
+
@spaces.GPU(duration=80)
|
| 354 |
+
def generate_single_image(text_prompt, slider_value, input_image, progress=gr.Progress(track_tqdm=True)):
|
| 355 |
if not input_image or not text_prompt or text_prompt.startswith("Please select"):
|
| 356 |
return None
|
| 357 |
|