fffiloni commited on
Commit
54d3be3
·
verified ·
1 Parent(s): 45dbfd8

Update app_df.py

Browse files
Files changed (1) hide show
  1. app_df.py +32 -3
app_df.py CHANGED
@@ -138,12 +138,16 @@ with gr.Blocks() as demo:
138
  with gr.Column():
139
 
140
  prompt = gr.Textbox(label="Prompt")
141
- model_id = gr.Dropdown(choices=model_options, value=model_options[0], label="Model ID")
142
- resolution = gr.Radio(choices=resolution_options, value="540P", label="Resolution", interactive=False)
143
- num_frames = gr.Slider(minimum=17, maximum=257, value=97, step=20, label="Number of Frames")
 
 
144
  image = gr.Image(type="filepath", label="Input Image (optional)")
145
 
146
  with gr.Accordion("Advanced Settings", open=False):
 
 
147
  ar_step = gr.Number(label="AR Step", value=0)
148
  causal_attention = gr.Checkbox(label="Causal Attention")
149
  causal_block_size = gr.Number(label="Causal Block Size", value=1)
@@ -178,6 +182,31 @@ with gr.Blocks() as demo:
178
  inputs = [prompt, image]
179
  )
180
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
181
  submit_btn.click(
182
  fn = generate_diffusion_forced_video,
183
  inputs = [
 
138
  with gr.Column():
139
 
140
  prompt = gr.Textbox(label="Prompt")
141
+
142
+ with gr.Row():
143
+ target_length = gr.Radio(label="Video length target", choices=["4", "10", "15", "30", "60"], value="4")
144
+
145
+ num_frames = gr.Slider(minimum=17, maximum=257, value=97, step=20, label="Number of Frames", interactive=False)
146
  image = gr.Image(type="filepath", label="Input Image (optional)")
147
 
148
  with gr.Accordion("Advanced Settings", open=False):
149
+ model_id = gr.Dropdown(choices=model_options, value=model_options[0], label="Model ID")
150
+ resolution = gr.Radio(choices=resolution_options, value="540P", label="Resolution", interactive=False)
151
  ar_step = gr.Number(label="AR Step", value=0)
152
  causal_attention = gr.Checkbox(label="Causal Attention")
153
  causal_block_size = gr.Number(label="Causal Block Size", value=1)
 
182
  inputs = [prompt, image]
183
  )
184
 
185
+ def set_num_frames(target_l):
186
+
187
+ n_frames = 0
188
+
189
+ if target_l == "4":
190
+ n_frames = 97
191
+ elif target_l == "10":
192
+ n_frames = 257
193
+ elif target_l == "15":
194
+ n_frames = 377
195
+ elif target_l == "30":
196
+ n_frames = 737
197
+ elif target_l == "60":
198
+ n_frames = 1457
199
+
200
+ return n_frames
201
+
202
+
203
+ target_length.change(
204
+ fn = set_num_frames,
205
+ inputs = [target_length],
206
+ outputs = [num_frames],
207
+ queue = False
208
+ )
209
+
210
  submit_btn.click(
211
  fn = generate_diffusion_forced_video,
212
  inputs = [