fffiloni commited on
Commit
2e70bd0
·
verified ·
1 Parent(s): f242db4

downgrade audio duration for better public experience

Browse files
Files changed (1) hide show
  1. webgui.py +3 -3
webgui.py CHANGED
@@ -253,7 +253,7 @@ def process_video(uploaded_img, uploaded_audio, width, height, length, seed, fac
253
 
254
  return final_output_path
255
 
256
- def trim_audio(file_path, output_path, max_duration=10):
257
  # Load the audio file
258
  audio = AudioSegment.from_wav(file_path)
259
 
@@ -269,10 +269,10 @@ def trim_audio(file_path, output_path, max_duration=10):
269
  print(f"Audio trimmed and saved as {output_path}")
270
  return output_path
271
 
272
- @spaces.GPU(duration=300)
273
  def generate_video(uploaded_img, uploaded_audio, width, height, length, seed, facemask_dilation_ratio, facecrop_dilation_ratio, context_frames, context_overlap, cfg, steps, sample_rate, fps, device, progress=gr.Progress(track_tqdm=True)):
274
  if is_shared_ui:
275
- gr.Info("Trimming audio to max 10 seconds. Duplicate the space for unlimited audio length.")
276
  uploaded_audio = trim_audio(uploaded_audio, "trimmed_audio.wav")
277
 
278
 
 
253
 
254
  return final_output_path
255
 
256
+ def trim_audio(file_path, output_path, max_duration=5):
257
  # Load the audio file
258
  audio = AudioSegment.from_wav(file_path)
259
 
 
269
  print(f"Audio trimmed and saved as {output_path}")
270
  return output_path
271
 
272
+ @spaces.GPU(duration=240)
273
  def generate_video(uploaded_img, uploaded_audio, width, height, length, seed, facemask_dilation_ratio, facecrop_dilation_ratio, context_frames, context_overlap, cfg, steps, sample_rate, fps, device, progress=gr.Progress(track_tqdm=True)):
274
  if is_shared_ui:
275
+ gr.Info("Trimming audio to max 5 seconds. Duplicate the space for unlimited audio length.")
276
  uploaded_audio = trim_audio(uploaded_audio, "trimmed_audio.wav")
277
 
278