dagloop5 commited on
Commit
8a48205
·
verified ·
1 Parent(s): b9beda5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +53 -28
app.py CHANGED
@@ -635,32 +635,44 @@ def on_highres_toggle(first_image, last_image, high_res):
635
  return gr.update(value=w), gr.update(value=h)
636
 
637
 
638
- def get_duration(
639
  first_image,
640
  last_image,
641
  prompt: str,
642
  negative_prompt: str,
643
  duration: float,
644
- seed: int,
645
- randomize_seed: bool,
646
- height: int,
647
- width: int,
648
- enhance_prompt: bool,
649
- video_cfg_scale: float,
650
- video_stg_scale: float,
651
- video_rescale_scale: float,
652
- video_a2v_scale: float,
653
- audio_cfg_scale: float,
654
- audio_stg_scale: float,
655
- audio_rescale_scale: float,
656
- audio_v2a_scale: float,
657
  gpu_duration: float,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
658
  progress=None,
659
  ) -> int:
660
  return int(gpu_duration)
661
 
662
 
663
- @spaces.GPU(duration=get_duration)
664
  @torch.inference_mode()
665
  def generate_video(
666
  first_image,
@@ -668,19 +680,32 @@ def generate_video(
668
  prompt: str,
669
  negative_prompt: str,
670
  duration: float,
671
- seed: int,
672
- randomize_seed: bool,
673
- height: int,
674
- width: int,
675
- enhance_prompt: bool,
676
- video_cfg_scale: float,
677
- video_stg_scale: float,
678
- video_rescale_scale: float,
679
- video_a2v_scale: float,
680
- audio_cfg_scale: float,
681
- audio_stg_scale: float,
682
- audio_rescale_scale: float,
683
- audio_v2a_scale: float,
 
 
 
 
 
 
 
 
 
 
 
 
 
684
  progress=gr.Progress(track_tqdm=True),
685
  ):
686
  try:
 
635
  return gr.update(value=w), gr.update(value=h)
636
 
637
 
638
+ def get_gpu_duration(
639
  first_image,
640
  last_image,
641
  prompt: str,
642
  negative_prompt: str,
643
  duration: float,
 
 
 
 
 
 
 
 
 
 
 
 
 
644
  gpu_duration: float,
645
+ enhance_prompt: bool = True,
646
+ randomize_seed: bool = True,
647
+ height: int = 1024,
648
+ width: int = 1536,
649
+ video_cfg_scale: float = 1.0,
650
+ video_stg_scale: float = 0.0,
651
+ video_rescale_scale: float = 0.45,
652
+ video_a2v_scale: float = 3.0,
653
+ audio_cfg_scale: float = 1.0,
654
+ audio_stg_scale: float = 0.0,
655
+ audio_rescale_scale: float = 1.0,
656
+ audio_v2a_scale: float = 3.0,
657
+ distilled_strength: float = 0.0,
658
+ pose_strength: float = 0.0,
659
+ general_strength: float = 0.0,
660
+ motion_strength: float = 0.0,
661
+ dreamlay_strength: float = 0.0,
662
+ mself_strength: float = 0.0,
663
+ dramatic_strength: float = 0.0,
664
+ fluid_strength: float = 0.0,
665
+ liquid_strength: float = 0.0,
666
+ demopose_strength: float = 0.0,
667
+ voice_strength: float = 0.0,
668
+ realism_strength: float = 0.0,
669
+ transition_strength: float = 0.0,
670
  progress=None,
671
  ) -> int:
672
  return int(gpu_duration)
673
 
674
 
675
+ @spaces.GPU(duration=get_gpu_duration)
676
  @torch.inference_mode()
677
  def generate_video(
678
  first_image,
 
680
  prompt: str,
681
  negative_prompt: str,
682
  duration: float,
683
+ gpu_duration: float,
684
+ enhance_prompt: bool = True,
685
+ randomize_seed: bool = True,
686
+ height: int = 1024,
687
+ width: int = 1536,
688
+ video_cfg_scale: float = 1.0,
689
+ video_stg_scale: float = 0.0,
690
+ video_rescale_scale: float = 0.45,
691
+ video_a2v_scale: float = 3.0,
692
+ audio_cfg_scale: float = 1.0,
693
+ audio_stg_scale: float = 0.0,
694
+ audio_rescale_scale: float = 1.0,
695
+ audio_v2a_scale: float = 3.0,
696
+ distilled_strength: float = 0.0,
697
+ pose_strength: float = 0.0,
698
+ general_strength: float = 0.0,
699
+ motion_strength: float = 0.0,
700
+ dreamlay_strength: float = 0.0,
701
+ mself_strength: float = 0.0,
702
+ dramatic_strength: float = 0.0,
703
+ fluid_strength: float = 0.0,
704
+ liquid_strength: float = 0.0,
705
+ demopose_strength: float = 0.0,
706
+ voice_strength: float = 0.0,
707
+ realism_strength: float = 0.0,
708
+ transition_strength: float = 0.0,
709
  progress=gr.Progress(track_tqdm=True),
710
  ):
711
  try: