multimodalart HF Staff commited on
Commit
8fda1dc
·
verified ·
1 Parent(s): 00544c9

tighten ZeroGPU duration from measured timings

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -260,9 +260,12 @@ def _estimate_duration(
260
  *args,
261
  **kwargs,
262
  ):
 
 
263
  chunks = int(num_chunks or 1)
264
  steps = int(num_inference_steps or 20)
265
- return int(min(1500, 70 + chunks * (steps * 9.0 + 25)))
 
266
 
267
 
268
  @spaces.GPU(duration=_estimate_duration, size="xlarge")
@@ -432,9 +435,9 @@ with gr.Blocks(title="EverAnimate") as demo:
432
  pose_video = gr.Video(label="Pose driving video", height=200)
433
  face_video = gr.Video(label="Face driving video (512×512)", height=200)
434
  num_chunks = gr.Slider(
435
- 1, 8, value=2, step=1,
436
  label="Chunks to generate",
437
- info="Each chunk is 77 frames ≈ 2.9 s of video at 25 fps.",
438
  )
439
  run_btn = gr.Button("Animate", variant="primary")
440
  gr.Markdown(NOTE)
 
260
  *args,
261
  **kwargs,
262
  ):
263
+ # Measured on ZeroGPU xlarge: 1 chunk x 20 steps = 147 s (~6.5 s/step + ~17 s
264
+ # of VAE encode/decode & anchor work). Keep this tight: xlarge costs 2x quota.
265
  chunks = int(num_chunks or 1)
266
  steps = int(num_inference_steps or 20)
267
+ raw = 25 + chunks * 4 + chunks * (steps * 6.6 + 20)
268
+ return int(min(1500, raw * 1.12))
269
 
270
 
271
  @spaces.GPU(duration=_estimate_duration, size="xlarge")
 
435
  pose_video = gr.Video(label="Pose driving video", height=200)
436
  face_video = gr.Video(label="Face driving video (512×512)", height=200)
437
  num_chunks = gr.Slider(
438
+ 1, 6, value=2, step=1,
439
  label="Chunks to generate",
440
+ info="Each chunk is 77 frames ≈ 2.9 s of video at 25 fps (~2.5 min of GPU each).",
441
  )
442
  run_btn = gr.Button("Animate", variant="primary")
443
  gr.Markdown(NOTE)