Spaces:
Running
on
Zero
Running
on
Zero
Update app_exp.py
Browse files- app_exp.py +19 -0
app_exp.py
CHANGED
|
@@ -129,6 +129,25 @@ def torch_gc():
|
|
| 129 |
torch.cuda.empty_cache()
|
| 130 |
torch.cuda.ipc_collect()
|
| 131 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 132 |
def generate_video(mode, prompt, neg_prompt, image, height, width, resolution,
|
| 133 |
seed, use_distill, use_refine, duration_sec, progress=gr.Progress(track_tqdm=True)):
|
| 134 |
|
|
|
|
| 129 |
torch.cuda.empty_cache()
|
| 130 |
torch.cuda.ipc_collect()
|
| 131 |
|
| 132 |
+
def check_duration(
|
| 133 |
+
mode,
|
| 134 |
+
prompt,
|
| 135 |
+
neg_prompt,
|
| 136 |
+
image,
|
| 137 |
+
height, width, resolution,
|
| 138 |
+
seed,
|
| 139 |
+
use_distill,
|
| 140 |
+
use_refine,
|
| 141 |
+
progress
|
| 142 |
+
):
|
| 143 |
+
if use_distill and resolution=="480p":
|
| 144 |
+
return 180
|
| 145 |
+
elif resolution=="720p":
|
| 146 |
+
return 360
|
| 147 |
+
else:
|
| 148 |
+
return 900
|
| 149 |
+
|
| 150 |
+
@spaces.GPU(duration=180)
|
| 151 |
def generate_video(mode, prompt, neg_prompt, image, height, width, resolution,
|
| 152 |
seed, use_distill, use_refine, duration_sec, progress=gr.Progress(track_tqdm=True)):
|
| 153 |
|