multimodalart HF Staff commited on
Commit
82fc0ee
·
verified ·
1 Parent(s): ffec15c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -2
app.py CHANGED
@@ -117,7 +117,23 @@ def torch_gc():
117
  torch.cuda.empty_cache()
118
  torch.cuda.ipc_collect()
119
 
120
- @spaces.GPU(duration=900)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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=False, info="Faster, lower quality base generation.")
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")