fffiloni commited on
Commit
f865d43
1 Parent(s): a4ad89d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -141,9 +141,9 @@ def run_inference(prompt, video_path, condition, video_length, seed, steps):
141
 
142
  print(f"RUNNING INFERENCE ...")
143
  if video_length > 12:
144
- command = f"python inference.py --prompt '{prompt}' --inference_steps {steps} --condition '{condition}' --video_path '{normalized}' --output_path '{output_path}' --temp_chunk_path 'result' --width 512 --height 512 --fps {target_fps} --seed {seed} --video_length {video_length} --smoother_steps 10 12 --is_long_video"
145
  else:
146
- command = f"python inference.py --prompt '{prompt}' --inference_steps {steps} --condition '{condition}' --video_path '{normalized}' --output_path '{output_path}' --temp_chunk_path 'result' --width 512 --height 512 --fps {target_fps} --seed {seed} --video_length {video_length} --smoother_steps 19 20"
147
  try:
148
  subprocess.run(command, shell=True)
149
 
@@ -157,7 +157,7 @@ def run_inference(prompt, video_path, condition, video_length, seed, steps):
157
 
158
  print(f"FINISHED !")
159
  return "done", 'resized_final.mp4'
160
- except:
161
  return "error", None
162
 
163
 
@@ -180,7 +180,7 @@ with gr.Blocks(css=css) as demo:
180
  with gr.Row():
181
  condition = gr.Dropdown(label="Condition", choices=["depth", "canny", "pose"], value="depth")
182
  seed = gr.Number(label="seed", value=42)
183
- inference_steps = gr.Slider(label="Inference steps", minimum=12, maximum=50, step=1, value=25)
184
  submit_btn = gr.Button("Submit")
185
  with gr.Column():
186
  video_res = gr.Video(label="result")
 
141
 
142
  print(f"RUNNING INFERENCE ...")
143
  if video_length > 12:
144
+ command = f"python inference.py --prompt '{prompt}' --inference_steps {steps} --condition '{condition}' --video_path '{normalized}' --output_path '{output_path}' --temp_chunk_path 'result' --width 512 --height 512 --fps {target_fps} --seed {seed} --video_length {video_length} --smoother_steps [19, 20] --is_long_video"
145
  else:
146
+ command = f"python inference.py --prompt '{prompt}' --inference_steps {steps} --condition '{condition}' --video_path '{normalized}' --output_path '{output_path}' --temp_chunk_path 'result' --width 512 --height 512 --fps {target_fps} --seed {seed} --video_length {video_length} --smoother_steps [19, 20]"
147
  try:
148
  subprocess.run(command, shell=True)
149
 
 
157
 
158
  print(f"FINISHED !")
159
  return "done", 'resized_final.mp4'
160
+ except RuntimeError:
161
  return "error", None
162
 
163
 
 
180
  with gr.Row():
181
  condition = gr.Dropdown(label="Condition", choices=["depth", "canny", "pose"], value="depth")
182
  seed = gr.Number(label="seed", value=42)
183
+ inference_steps = gr.Slider(label="Inference steps", minimum=25, maximum=50, step=1, value=25)
184
  submit_btn = gr.Button("Submit")
185
  with gr.Column():
186
  video_res = gr.Video(label="result")