BoxOfColors Claude Sonnet 4.6 commited on
Commit
482b9b5
Β·
1 Parent(s): dec15b9

Fix regen duration functions: add slot_id=None param to match regen function signatures

Browse files

@spaces.GPU(duration=fn) passes all args to the duration function,
so it must accept the same signature as the decorated function.
All three regen functions take slot_id as the last arg.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -845,7 +845,7 @@ def _splice_and_save(new_wav, seg_idx, meta, slot_id):
845
 
846
  def _taro_regen_duration(video_file, seg_idx, seg_meta_json,
847
  seed_val, cfg_scale, num_steps, mode,
848
- crossfade_s, crossfade_db):
849
  secs = int(num_steps) * TARO_SECS_PER_STEP + TARO_LOAD_OVERHEAD
850
  result = min(GPU_DURATION_CAP, max(60, int(secs)))
851
  print(f"[duration] TARO regen: 1 seg Γ— {int(num_steps)} steps β†’ {secs:.0f}s β†’ capped {result}s")
@@ -920,7 +920,7 @@ def regen_taro_segment(video_file, seg_idx, seg_meta_json,
920
 
921
  def _mmaudio_regen_duration(video_file, seg_idx, seg_meta_json,
922
  prompt, negative_prompt, seed_val,
923
- cfg_strength, num_steps, crossfade_s, crossfade_db):
924
  secs = int(num_steps) * MMAUDIO_SECS_PER_STEP + MMAUDIO_LOAD_OVERHEAD
925
  result = min(GPU_DURATION_CAP, max(60, int(secs)))
926
  print(f"[duration] MMAudio regen: 1 seg Γ— {int(num_steps)} steps β†’ {secs:.0f}s β†’ capped {result}s")
@@ -1010,7 +1010,7 @@ def regen_mmaudio_segment(video_file, seg_idx, seg_meta_json,
1010
  def _hunyuan_regen_duration(video_file, seg_idx, seg_meta_json,
1011
  prompt, negative_prompt, seed_val,
1012
  guidance_scale, num_steps, model_size,
1013
- crossfade_s, crossfade_db):
1014
  secs = int(num_steps) * HUNYUAN_SECS_PER_STEP + HUNYUAN_LOAD_OVERHEAD
1015
  result = min(GPU_DURATION_CAP, max(60, int(secs)))
1016
  print(f"[duration] HunyuanFoley regen: 1 seg Γ— {int(num_steps)} steps β†’ {secs:.0f}s β†’ capped {result}s")
 
845
 
846
  def _taro_regen_duration(video_file, seg_idx, seg_meta_json,
847
  seed_val, cfg_scale, num_steps, mode,
848
+ crossfade_s, crossfade_db, slot_id=None):
849
  secs = int(num_steps) * TARO_SECS_PER_STEP + TARO_LOAD_OVERHEAD
850
  result = min(GPU_DURATION_CAP, max(60, int(secs)))
851
  print(f"[duration] TARO regen: 1 seg Γ— {int(num_steps)} steps β†’ {secs:.0f}s β†’ capped {result}s")
 
920
 
921
  def _mmaudio_regen_duration(video_file, seg_idx, seg_meta_json,
922
  prompt, negative_prompt, seed_val,
923
+ cfg_strength, num_steps, crossfade_s, crossfade_db, slot_id=None):
924
  secs = int(num_steps) * MMAUDIO_SECS_PER_STEP + MMAUDIO_LOAD_OVERHEAD
925
  result = min(GPU_DURATION_CAP, max(60, int(secs)))
926
  print(f"[duration] MMAudio regen: 1 seg Γ— {int(num_steps)} steps β†’ {secs:.0f}s β†’ capped {result}s")
 
1010
  def _hunyuan_regen_duration(video_file, seg_idx, seg_meta_json,
1011
  prompt, negative_prompt, seed_val,
1012
  guidance_scale, num_steps, model_size,
1013
+ crossfade_s, crossfade_db, slot_id=None):
1014
  secs = int(num_steps) * HUNYUAN_SECS_PER_STEP + HUNYUAN_LOAD_OVERHEAD
1015
  result = min(GPU_DURATION_CAP, max(60, int(secs)))
1016
  print(f"[duration] HunyuanFoley regen: 1 seg Γ— {int(num_steps)} steps β†’ {secs:.0f}s β†’ capped {result}s")