Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -117,7 +117,23 @@ def torch_gc():
|
|
| 117 |
torch.cuda.empty_cache()
|
| 118 |
torch.cuda.ipc_collect()
|
| 119 |
|
| 120 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 121 |
def generate_video(
|
| 122 |
mode,
|
| 123 |
prompt,
|
|
@@ -255,7 +271,7 @@ with gr.Blocks(css="style.css") as demo:
|
|
| 255 |
width_t2v = gr.Slider(label="Width", minimum=256, maximum=1024, value=832, step=64)
|
| 256 |
with gr.Row():
|
| 257 |
seed_t2v = gr.Number(label="Seed", value=42, precision=0)
|
| 258 |
-
distill_t2v = gr.Checkbox(label="Use Distill Mode", value=
|
| 259 |
refine_t2v = gr.Checkbox(label="Use Refine Mode", value=False, info="Higher quality & resolution, but slower. Uses Distill mode for its first stage.")
|
| 260 |
|
| 261 |
t2v_button = gr.Button("Generate Video", variant="primary")
|
|
|
|
| 117 |
torch.cuda.empty_cache()
|
| 118 |
torch.cuda.ipc_collect()
|
| 119 |
|
| 120 |
+
def check_duration(
|
| 121 |
+
mode,
|
| 122 |
+
prompt,
|
| 123 |
+
neg_prompt,
|
| 124 |
+
image,
|
| 125 |
+
height, width, resolution,
|
| 126 |
+
seed,
|
| 127 |
+
use_distill,
|
| 128 |
+
use_refine,
|
| 129 |
+
):
|
| 130 |
+
if use_refine:
|
| 131 |
+
return 200
|
| 132 |
+
else:
|
| 133 |
+
return 900
|
| 134 |
+
|
| 135 |
+
|
| 136 |
+
@spaces.GPU(check_duration)
|
| 137 |
def generate_video(
|
| 138 |
mode,
|
| 139 |
prompt,
|
|
|
|
| 271 |
width_t2v = gr.Slider(label="Width", minimum=256, maximum=1024, value=832, step=64)
|
| 272 |
with gr.Row():
|
| 273 |
seed_t2v = gr.Number(label="Seed", value=42, precision=0)
|
| 274 |
+
distill_t2v = gr.Checkbox(label="Use Distill Mode", value=True, info="Faster, lower quality base generation.")
|
| 275 |
refine_t2v = gr.Checkbox(label="Use Refine Mode", value=False, info="Higher quality & resolution, but slower. Uses Distill mode for its first stage.")
|
| 276 |
|
| 277 |
t2v_button = gr.Button("Generate Video", variant="primary")
|