Spaces:
Sleeping
Sleeping
LTX: duration 85 + 16 steps to fit the remaining anonymous ZeroGPU quota
Browse files
ltx.py
CHANGED
|
@@ -50,11 +50,13 @@ def _load_pipe():
|
|
| 50 |
|
| 51 |
|
| 52 |
# ZeroGPU laws (learned live 2026-11-06): spaces multiplies the requested
|
| 53 |
-
# duration by 1.5 when reserving (300→"450s"
|
| 54 |
-
#
|
| 55 |
-
#
|
| 56 |
-
#
|
| 57 |
-
|
|
|
|
|
|
|
| 58 |
def ltx_clip(image_path, prompt, seconds, out_path):
|
| 59 |
"""Animate `image_path` into a ~`seconds`-long clip at `out_path`.
|
| 60 |
Returns the output path. Raises on any failure (caller falls back)."""
|
|
@@ -73,7 +75,7 @@ def ltx_clip(image_path, prompt, seconds, out_path):
|
|
| 73 |
width=704,
|
| 74 |
height=480,
|
| 75 |
num_frames=frames_n,
|
| 76 |
-
num_inference_steps=
|
| 77 |
).frames[0]
|
| 78 |
out_path = Path(out_path)
|
| 79 |
export_to_video(frames, str(out_path), fps=24)
|
|
|
|
| 50 |
|
| 51 |
|
| 52 |
# ZeroGPU laws (learned live 2026-11-06): spaces multiplies the requested
|
| 53 |
+
# duration by 1.5 when reserving (300→"450s", 180→"270s", 120→180s — all
|
| 54 |
+
# confirmed in error messages), and the desk checks the reservation against
|
| 55 |
+
# the CALLER's remaining daily quota. The anonymous pool had 136s left, so
|
| 56 |
+
# duration=85 (reserves ~128s) squeezes under it; authenticating with the
|
| 57 |
+
# owner's HF token raises the pool to the account's own 5 GPU-min/day.
|
| 58 |
+
# Generation is trimmed to fit the smaller window: 16 steps.
|
| 59 |
+
@spaces.GPU(duration=85)
|
| 60 |
def ltx_clip(image_path, prompt, seconds, out_path):
|
| 61 |
"""Animate `image_path` into a ~`seconds`-long clip at `out_path`.
|
| 62 |
Returns the output path. Raises on any failure (caller falls back)."""
|
|
|
|
| 75 |
width=704,
|
| 76 |
height=480,
|
| 77 |
num_frames=frames_n,
|
| 78 |
+
num_inference_steps=16,
|
| 79 |
).frames[0]
|
| 80 |
out_path = Path(out_path)
|
| 81 |
export_to_video(frames, str(out_path), fps=24)
|