BoxOfColors commited on
Commit
5cb2f31
·
1 Parent(s): b9a8d80

Fix ZeroGPU kwarg stripping: make silent_video/segments_json positional

Browse files

ZeroGPU only forwards positional args to the GPU worker process — kwargs
are silently dropped, arriving as None and causing json.loads(None) crash.

Make silent_video, segments_json (MMAudio) and silent_video, segments_json,
total_dur_s (HunyuanFoley) required positional params in the gpu_infer
functions so ZeroGPU passes them through correctly.

Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -1015,7 +1015,7 @@ def _mmaudio_duration(video_file, prompt, negative_prompt, seed_val,
1015
  @spaces.GPU(duration=_mmaudio_duration)
1016
  def _mmaudio_gpu_infer(video_file, prompt, negative_prompt, seed_val,
1017
  cfg_strength, num_steps, crossfade_s, crossfade_db, num_samples,
1018
- silent_video=None, segments_json=None):
1019
  """GPU-only MMAudio inference — model loading + flow-matching generation.
1020
  Returns list of (seg_audios, sr) per sample.
1021
 
@@ -1163,7 +1163,7 @@ def _hunyuan_duration(video_file, prompt, negative_prompt, seed_val,
1163
  @spaces.GPU(duration=_hunyuan_duration)
1164
  def _hunyuan_gpu_infer(video_file, prompt, negative_prompt, seed_val,
1165
  guidance_scale, num_steps, model_size, crossfade_s, crossfade_db,
1166
- num_samples, silent_video=None, segments_json=None, total_dur_s=None):
1167
  """GPU-only HunyuanFoley inference — model loading + feature extraction + denoising.
1168
  Returns list of (seg_wavs, sr, text_feats) per sample.
1169
 
 
1015
  @spaces.GPU(duration=_mmaudio_duration)
1016
  def _mmaudio_gpu_infer(video_file, prompt, negative_prompt, seed_val,
1017
  cfg_strength, num_steps, crossfade_s, crossfade_db, num_samples,
1018
+ silent_video, segments_json):
1019
  """GPU-only MMAudio inference — model loading + flow-matching generation.
1020
  Returns list of (seg_audios, sr) per sample.
1021
 
 
1163
  @spaces.GPU(duration=_hunyuan_duration)
1164
  def _hunyuan_gpu_infer(video_file, prompt, negative_prompt, seed_val,
1165
  guidance_scale, num_steps, model_size, crossfade_s, crossfade_db,
1166
+ num_samples, silent_video, segments_json, total_dur_s):
1167
  """GPU-only HunyuanFoley inference — model loading + feature extraction + denoising.
1168
  Returns list of (seg_wavs, sr, text_feats) per sample.
1169