Spaces:
Running on Zero
Running on Zero
tighten ZeroGPU duration from measured timings
Browse files
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 |
-
|
|
|
|
| 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,
|
| 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)
|