Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -78,40 +78,40 @@ pipeline = TI2VidTwoStagesPipeline(
|
|
| 78 |
local_files_only=False
|
| 79 |
)
|
| 80 |
|
| 81 |
-
print("=" * 80)
|
| 82 |
-
print("Warming up pipeline (loading Gemma text encoder)...")
|
| 83 |
-
print("=" * 80)
|
| 84 |
-
|
| 85 |
-
# Do a dummy warmup to load all models including Gemma
|
| 86 |
-
import tempfile
|
| 87 |
-
import os
|
| 88 |
-
warmup_output = tempfile.mktemp(suffix=".mp4")
|
| 89 |
-
try:
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
except Exception as e:
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
print("=" * 80)
|
| 111 |
-
print("Pipeline fully loaded and ready!")
|
| 112 |
-
print("=" * 80)
|
| 113 |
-
|
| 114 |
-
|
| 115 |
def generate_video(
|
| 116 |
input_image,
|
| 117 |
prompt: str,
|
|
@@ -184,7 +184,6 @@ def generate_video(
|
|
| 184 |
# Create Gradio interface
|
| 185 |
with gr.Blocks(title="LTX-2 Image-to-Video") as demo:
|
| 186 |
gr.Markdown("# LTX-2 Image-to-Video Generation")
|
| 187 |
-
gr.Markdown("Transform images into videos using the LTX-2 2-stage pipeline")
|
| 188 |
|
| 189 |
with gr.Row():
|
| 190 |
with gr.Column():
|
|
|
|
| 78 |
local_files_only=False
|
| 79 |
)
|
| 80 |
|
| 81 |
+
# print("=" * 80)
|
| 82 |
+
# print("Warming up pipeline (loading Gemma text encoder)...")
|
| 83 |
+
# print("=" * 80)
|
| 84 |
+
|
| 85 |
+
# # Do a dummy warmup to load all models including Gemma
|
| 86 |
+
# import tempfile
|
| 87 |
+
# import os
|
| 88 |
+
# warmup_output = tempfile.mktemp(suffix=".mp4")
|
| 89 |
+
# try:
|
| 90 |
+
# pipeline(
|
| 91 |
+
# prompt="warmup",
|
| 92 |
+
# negative_prompt="",
|
| 93 |
+
# output_path=warmup_output,
|
| 94 |
+
# seed=42,
|
| 95 |
+
# height=256,
|
| 96 |
+
# width=256,
|
| 97 |
+
# num_frames=9,
|
| 98 |
+
# frame_rate=8,
|
| 99 |
+
# num_inference_steps=1,
|
| 100 |
+
# cfg_guidance_scale=1.0,
|
| 101 |
+
# images=[],
|
| 102 |
+
# tiling_config=TilingConfig.default(),
|
| 103 |
+
# )
|
| 104 |
+
# # Clean up warmup output
|
| 105 |
+
# if os.path.exists(warmup_output):
|
| 106 |
+
# os.remove(warmup_output)
|
| 107 |
+
# except Exception as e:
|
| 108 |
+
# print(f"Warmup completed with note: {e}")
|
| 109 |
+
|
| 110 |
+
# print("=" * 80)
|
| 111 |
+
# print("Pipeline fully loaded and ready!")
|
| 112 |
+
# print("=" * 80)
|
| 113 |
+
|
| 114 |
+
@spaces.GPU(duration=300)
|
| 115 |
def generate_video(
|
| 116 |
input_image,
|
| 117 |
prompt: str,
|
|
|
|
| 184 |
# Create Gradio interface
|
| 185 |
with gr.Blocks(title="LTX-2 Image-to-Video") as demo:
|
| 186 |
gr.Markdown("# LTX-2 Image-to-Video Generation")
|
|
|
|
| 187 |
|
| 188 |
with gr.Row():
|
| 189 |
with gr.Column():
|