duongsd commited on
Commit
d8f7ecf
·
verified ·
1 Parent(s): 1229c87

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -456,7 +456,7 @@ def get_inference_duration(
456
  if safe_mode:
457
  total_time = total_time * 1.30
458
 
459
- return total_time
460
 
461
 
462
  @spaces.GPU(duration=get_inference_duration, size='xlarge')
@@ -555,7 +555,7 @@ def generate_video(
555
  safe_mode=False,
556
  video_component=True,
557
  loop=False,
558
- resolution="480p",
559
  progress=gr.Progress(track_tqdm=True),
560
  ):
561
  """
@@ -662,7 +662,7 @@ with gr.Blocks(delete_cache=(3600, 10800)) as demo:
662
  input_image_component = gr.Image(type="pil", label="Start Frame", sources=["upload", "clipboard"])
663
  last_image_component = gr.Image(type="pil", label="End Frame (Optional)", sources=["upload", "clipboard"])
664
  loop_checkbox = gr.Checkbox(label="🔁 Loop (dùng Start Frame làm End Frame)", value=False)
665
- resolution_input = gr.Radio(["480p", "720p"], value="480p", label="Resolution")
666
  prompt_input = gr.Textbox(label="Prompt", value=default_prompt_i2v)
667
  duration_seconds_input = gr.Slider(minimum=MIN_DURATION, maximum=MAX_DURATION, step=0.1, value=3.5, label="Duration (seconds)", info=f"Clamped to model's {MIN_FRAMES_MODEL}-{MAX_FRAMES_MODEL} frames at {FIXED_FPS}fps.")
668
  frame_multi = gr.Dropdown(
 
456
  if safe_mode:
457
  total_time = total_time * 1.30
458
 
459
+ return min(int(total_time * 1.25), 300)
460
 
461
 
462
  @spaces.GPU(duration=get_inference_duration, size='xlarge')
 
555
  safe_mode=False,
556
  video_component=True,
557
  loop=False,
558
+ resolution="720p",
559
  progress=gr.Progress(track_tqdm=True),
560
  ):
561
  """
 
662
  input_image_component = gr.Image(type="pil", label="Start Frame", sources=["upload", "clipboard"])
663
  last_image_component = gr.Image(type="pil", label="End Frame (Optional)", sources=["upload", "clipboard"])
664
  loop_checkbox = gr.Checkbox(label="🔁 Loop (dùng Start Frame làm End Frame)", value=False)
665
+ resolution_input = gr.Radio(["480p", "720p"], value="720p", label="Resolution")
666
  prompt_input = gr.Textbox(label="Prompt", value=default_prompt_i2v)
667
  duration_seconds_input = gr.Slider(minimum=MIN_DURATION, maximum=MAX_DURATION, step=0.1, value=3.5, label="Duration (seconds)", info=f"Clamped to model's {MIN_FRAMES_MODEL}-{MAX_FRAMES_MODEL} frames at {FIXED_FPS}fps.")
668
  frame_multi = gr.Dropdown(