Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -591,6 +591,25 @@ def generate_video_example(input_image, prompt, camera_lora, resolution, progres
|
|
| 591 |
|
| 592 |
return output_video
|
| 593 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 594 |
def get_duration(
|
| 595 |
input_image,
|
| 596 |
prompt,
|
|
@@ -1280,6 +1299,50 @@ with gr.Blocks(title="LTX-2 Video Distilled 🎥🔈") as demo:
|
|
| 1280 |
outputs=[output_video,seed]
|
| 1281 |
)
|
| 1282 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1283 |
# Add example
|
| 1284 |
gr.Examples(
|
| 1285 |
examples=[
|
|
@@ -1327,7 +1390,7 @@ with gr.Blocks(title="LTX-2 Video Distilled 🎥🔈") as demo:
|
|
| 1327 |
fn=generate_video_example,
|
| 1328 |
inputs=[input_image, prompt_ui, camera_lora_ui, radioanimated_resolution],
|
| 1329 |
outputs = [output_video],
|
| 1330 |
-
label="
|
| 1331 |
cache_examples=True,
|
| 1332 |
)
|
| 1333 |
|
|
|
|
| 591 |
|
| 592 |
return output_video
|
| 593 |
|
| 594 |
+
|
| 595 |
+
def generate_video_example_t2v(prompt, camera_lora, resolution, progress=gr.Progress(track_tqdm=True)):
|
| 596 |
+
|
| 597 |
+
w, h = apply_resolution(resolution)
|
| 598 |
+
|
| 599 |
+
output_video, seed = generate_video(
|
| 600 |
+
None,
|
| 601 |
+
prompt,
|
| 602 |
+
15, # duration seconds
|
| 603 |
+
True, # enhance_prompt
|
| 604 |
+
42, # seed
|
| 605 |
+
True, # randomize_seed
|
| 606 |
+
h, # height
|
| 607 |
+
w, # width
|
| 608 |
+
camera_lora,
|
| 609 |
+
progress
|
| 610 |
+
)
|
| 611 |
+
return output_video
|
| 612 |
+
|
| 613 |
def get_duration(
|
| 614 |
input_image,
|
| 615 |
prompt,
|
|
|
|
| 1299 |
outputs=[output_video,seed]
|
| 1300 |
)
|
| 1301 |
|
| 1302 |
+
|
| 1303 |
+
timestep_prompt = """Style: Realistic live-action, cinematic, shallow depth of field, 24 fps, natural and dramatic lighting
|
| 1304 |
+
|
| 1305 |
+
Environment: Interior of a space station module or realistic mock-up, metal panels, blinking lights, Earth visible through a large window
|
| 1306 |
+
|
| 1307 |
+
Character:
|
| 1308 |
+
|
| 1309 |
+
Woman: mid-30s, athletic build, wearing authentic-style futuristic space suit (real materials, fabric details, visible patches); calm, confident, precise movements; hair tucked or braided; expressive eyes visible through visor, reflecting focus and awe
|
| 1310 |
+
|
| 1311 |
+
Timestamps & action sequence:
|
| 1312 |
+
|
| 1313 |
+
0:00–0:05 — Close-up on her face through visor; soft reflections of Earth and panels in her eyes; she adjusts her gloves and glances around, calm and focused.
|
| 1314 |
+
|
| 1315 |
+
0:05–0:10 — Medium shot; she moves to the large window, gazes out as the sun begins to rise over Earth’s horizon; her expression shifts slightly, squinting at the bright sunlight.
|
| 1316 |
+
|
| 1317 |
+
0:10–0:15 — Close-up on her face; she squints, shading her eyes with a gloved hand, mutters with dry humor: “Damn thing is blinding.” Camera captures Earth glowing in the background with cinematic lens flare across the window edge.
|
| 1318 |
+
|
| 1319 |
+
Audio:
|
| 1320 |
+
|
| 1321 |
+
Woman: calm, soft-spoken, slight dry humor, low tone
|
| 1322 |
+
|
| 1323 |
+
Environment: soft hum of space station, faint beeps from panels
|
| 1324 |
+
|
| 1325 |
+
Music: subtle cinematic synth or ambient pad, futuristic and minimal, emphasizing awe and solitude"""
|
| 1326 |
+
|
| 1327 |
+
|
| 1328 |
+
gr.Examples(
|
| 1329 |
+
examples=[
|
| 1330 |
+
|
| 1331 |
+
[
|
| 1332 |
+
timestep_prompt,
|
| 1333 |
+
"No LoRA",
|
| 1334 |
+
"16:9",
|
| 1335 |
+
],
|
| 1336 |
+
|
| 1337 |
+
],
|
| 1338 |
+
fn=generate_video_example_t2v,
|
| 1339 |
+
inputs=[prompt_ui, camera_lora_ui, radioanimated_resolution],
|
| 1340 |
+
outputs = [output_video],
|
| 1341 |
+
label="T2V Example",
|
| 1342 |
+
cache_examples=True,
|
| 1343 |
+
)
|
| 1344 |
+
|
| 1345 |
+
|
| 1346 |
# Add example
|
| 1347 |
gr.Examples(
|
| 1348 |
examples=[
|
|
|
|
| 1390 |
fn=generate_video_example,
|
| 1391 |
inputs=[input_image, prompt_ui, camera_lora_ui, radioanimated_resolution],
|
| 1392 |
outputs = [output_video],
|
| 1393 |
+
label="I2V Examples",
|
| 1394 |
cache_examples=True,
|
| 1395 |
)
|
| 1396 |
|