C4G-HKUST commited on
Commit
a3f3eee
·
1 Parent(s): 5440852

Update GPU duration to 720s and 2p-2 generation time to ~11 minutes

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -598,7 +598,7 @@ def run_graio_demo(args):
598
  # 使用 @spaces.GPU 装饰器包装 generate_video 函数(参考 LivePortrait)
599
  # 参考: https://huggingface.co/spaces/KlingTeam/LivePortrait/blob/main/app.py
600
  # @spaces.GPU 装饰器会自动处理 GPU 初始化,不需要手动初始化
601
- @spaces.GPU(duration=600)
602
  def gpu_wrapped_generate_video(*args, **kwargs):
603
  # 在 worker 进程中将模型移动到 GPU(如果模型在 CPU 上)
604
  # 参考 LivePortrait: 在 worker 进程中直接使用 .to("cuda")
@@ -765,7 +765,7 @@ def run_graio_demo(args):
765
  examples = [
766
  ["./input_example/images/1p-0.png", "~4 minutes", "The man stands in the dusty western street, backlit by the setting sun, and his determined gaze speaks of a rugged spirit.", "1 Person", "pad", "./input_example/audios/1p-0.wav", None, None],
767
  ["./input_example/images/2p-1.png", "~8 minutes", "In a casual, intimate setting, a man and a woman are engaged in a heartfelt conversation inside a car. The man, sporting a denim jacket over a blue shirt, sits attentively with a seatbelt fastened, his gaze fixed on the woman beside him. The woman, wearing a black tank top and a denim jacket draped over her shoulders, smiles warmly, her eyes reflecting genuine interest and connection. The car's interior, with its beige seats and simple design, provides a backdrop that emphasizes their interaction. The scene captures a moment of shared understanding and connection, set against the soft, diffused light of an overcast day. A medium shot from a slightly angled perspective, focusing on their expressions and body language.", "2 Persons", "pad", "./input_example/audios/2p-1-left.wav", "./input_example/audios/2p-1-right.wav", None],
768
- ["./input_example/images/2p-2.png", "~10 minutes", "In a cozy recording studio, a man and a woman are singing together. The man, with tousled brown hair, stands to the left, wearing a light green button-down shirt. His gaze is directed towards the woman, who is smiling warmly. She, with wavy dark hair, is dressed in a black floral dress and stands to the right, her eyes closed in enjoyment. Between them is a professional microphone, capturing their harmonious voices. The background features wooden panels and various audio equipment, creating an intimate and focused atmosphere. The lighting is soft and warm, highlighting their expressions and the intimate setting. A medium shot captures their interaction closely.", "2 Persons", "pad", "./input_example/audios/2p-2-left.wav", "./input_example/audios/2p-2-right.wav", None],
769
  ],
770
  inputs = [img2vid_image, generation_time_display, img2vid_prompt, person_num_selector, audio_mode_selector, img2vid_audio_1, img2vid_audio_2, img2vid_audio_3],
771
  outputs = [img2vid_image, img2vid_prompt, person_num_selector, audio_mode_selector, img2vid_audio_1, img2vid_audio_2, img2vid_audio_3, generation_time_display],
 
598
  # 使用 @spaces.GPU 装饰器包装 generate_video 函数(参考 LivePortrait)
599
  # 参考: https://huggingface.co/spaces/KlingTeam/LivePortrait/blob/main/app.py
600
  # @spaces.GPU 装饰器会自动处理 GPU 初始化,不需要手动初始化
601
+ @spaces.GPU(duration=720)
602
  def gpu_wrapped_generate_video(*args, **kwargs):
603
  # 在 worker 进程中将模型移动到 GPU(如果模型在 CPU 上)
604
  # 参考 LivePortrait: 在 worker 进程中直接使用 .to("cuda")
 
765
  examples = [
766
  ["./input_example/images/1p-0.png", "~4 minutes", "The man stands in the dusty western street, backlit by the setting sun, and his determined gaze speaks of a rugged spirit.", "1 Person", "pad", "./input_example/audios/1p-0.wav", None, None],
767
  ["./input_example/images/2p-1.png", "~8 minutes", "In a casual, intimate setting, a man and a woman are engaged in a heartfelt conversation inside a car. The man, sporting a denim jacket over a blue shirt, sits attentively with a seatbelt fastened, his gaze fixed on the woman beside him. The woman, wearing a black tank top and a denim jacket draped over her shoulders, smiles warmly, her eyes reflecting genuine interest and connection. The car's interior, with its beige seats and simple design, provides a backdrop that emphasizes their interaction. The scene captures a moment of shared understanding and connection, set against the soft, diffused light of an overcast day. A medium shot from a slightly angled perspective, focusing on their expressions and body language.", "2 Persons", "pad", "./input_example/audios/2p-1-left.wav", "./input_example/audios/2p-1-right.wav", None],
768
+ ["./input_example/images/2p-2.png", "~11 minutes", "In a cozy recording studio, a man and a woman are singing together. The man, with tousled brown hair, stands to the left, wearing a light green button-down shirt. His gaze is directed towards the woman, who is smiling warmly. She, with wavy dark hair, is dressed in a black floral dress and stands to the right, her eyes closed in enjoyment. Between them is a professional microphone, capturing their harmonious voices. The background features wooden panels and various audio equipment, creating an intimate and focused atmosphere. The lighting is soft and warm, highlighting their expressions and the intimate setting. A medium shot captures their interaction closely.", "2 Persons", "pad", "./input_example/audios/2p-2-left.wav", "./input_example/audios/2p-2-right.wav", None],
769
  ],
770
  inputs = [img2vid_image, generation_time_display, img2vid_prompt, person_num_selector, audio_mode_selector, img2vid_audio_1, img2vid_audio_2, img2vid_audio_3],
771
  outputs = [img2vid_image, img2vid_prompt, person_num_selector, audio_mode_selector, img2vid_audio_1, img2vid_audio_2, img2vid_audio_3, generation_time_display],