Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
import os
|
2 |
import subprocess
|
3 |
import tempfile
|
@@ -11,6 +12,7 @@ ckpt_dir = snapshot_download(repo_id, local_dir_use_symlinks=False)
|
|
11 |
print(f"Using checkpoints from {ckpt_dir}")
|
12 |
|
13 |
# ---------------- Step 2: Generation Functions ----------------
|
|
|
14 |
def generate_t2v(prompt, size="1280*704"):
|
15 |
"""Text-to-Video generation."""
|
16 |
if not prompt.strip():
|
@@ -45,6 +47,8 @@ def generate_t2v(prompt, size="1280*704"):
|
|
45 |
|
46 |
return output_path, "Text-to-Video generated successfully!"
|
47 |
|
|
|
|
|
48 |
def generate_i2v(image, prompt, size="1280*704"):
|
49 |
"""Image-to-Video generation."""
|
50 |
if image is None or not prompt.strip():
|
|
|
1 |
+
import spaces
|
2 |
import os
|
3 |
import subprocess
|
4 |
import tempfile
|
|
|
12 |
print(f"Using checkpoints from {ckpt_dir}")
|
13 |
|
14 |
# ---------------- Step 2: Generation Functions ----------------
|
15 |
+
@spaces.GPU(duration=100)
|
16 |
def generate_t2v(prompt, size="1280*704"):
|
17 |
"""Text-to-Video generation."""
|
18 |
if not prompt.strip():
|
|
|
47 |
|
48 |
return output_path, "Text-to-Video generated successfully!"
|
49 |
|
50 |
+
|
51 |
+
@spaces.GPU(duration=100)
|
52 |
def generate_i2v(image, prompt, size="1280*704"):
|
53 |
"""Image-to-Video generation."""
|
54 |
if image is None or not prompt.strip():
|