Spaces:
Running
on
Zero
Running
on
Zero
downgrade audio duration for better public experience
Browse files
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=
|
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=
|
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
|
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 |
|