Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -368,8 +368,99 @@ def generate_video(
|
|
| 368 |
return None
|
| 369 |
|
| 370 |
|
| 371 |
-
|
| 372 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 373 |
gr.HTML(
|
| 374 |
"""
|
| 375 |
<div style="text-align: left;">
|
|
@@ -388,7 +479,7 @@ with gr.Blocks(title="LTX-2 Video Distilled 🎥🔈") as demo:
|
|
| 388 |
"""
|
| 389 |
)
|
| 390 |
with gr.Row():
|
| 391 |
-
with gr.Column():
|
| 392 |
input_image = gr.Image(
|
| 393 |
label="Input Image (Optional)",
|
| 394 |
type="pil",
|
|
@@ -440,9 +531,9 @@ with gr.Blocks(title="LTX-2 Video Distilled 🎥🔈") as demo:
|
|
| 440 |
precision=0
|
| 441 |
)
|
| 442 |
|
| 443 |
-
with gr.Column():
|
| 444 |
output_video = gr.Video(label="Generated Video", autoplay=True, height=512)
|
| 445 |
-
generate_btn = gr.Button("Generate Video", variant="primary",
|
| 446 |
|
| 447 |
generate_btn.click(
|
| 448 |
fn=generate_video,
|
|
@@ -487,8 +578,6 @@ with gr.Blocks(title="LTX-2 Video Distilled 🎥🔈") as demo:
|
|
| 487 |
)
|
| 488 |
|
| 489 |
|
| 490 |
-
|
| 491 |
-
.gradio-container .contain{max-width: 1200px !important; margin: 0 auto !important}
|
| 492 |
-
'''
|
| 493 |
if __name__ == "__main__":
|
| 494 |
demo.launch()
|
|
|
|
| 368 |
return None
|
| 369 |
|
| 370 |
|
| 371 |
+
css = """
|
| 372 |
+
#col-container {
|
| 373 |
+
margin: 0 auto;
|
| 374 |
+
max-width: 1600px;
|
| 375 |
+
}
|
| 376 |
+
#modal-container {
|
| 377 |
+
width: 100vw; /* Take full viewport width */
|
| 378 |
+
height: 100vh; /* Take full viewport height (optional) */
|
| 379 |
+
display: flex;
|
| 380 |
+
justify-content: center; /* Center content horizontally */
|
| 381 |
+
align-items: center; /* Center content vertically if desired */
|
| 382 |
+
}
|
| 383 |
+
#modal-content {
|
| 384 |
+
width: 100%;
|
| 385 |
+
max-width: 700px; /* Limit content width */
|
| 386 |
+
margin: 0 auto;
|
| 387 |
+
border-radius: 8px;
|
| 388 |
+
padding: 1.5rem;
|
| 389 |
+
}
|
| 390 |
+
#step-column {
|
| 391 |
+
padding: 10px;
|
| 392 |
+
border-radius: 8px;
|
| 393 |
+
box-shadow: var(--card-shadow);
|
| 394 |
+
margin: 10px;
|
| 395 |
+
}
|
| 396 |
+
#col-showcase {
|
| 397 |
+
margin: 0 auto;
|
| 398 |
+
max-width: 1100px;
|
| 399 |
+
}
|
| 400 |
+
.button-gradient {
|
| 401 |
+
background: linear-gradient(45deg, rgb(255, 65, 108), rgb(255, 75, 43), rgb(255, 155, 0), rgb(255, 65, 108)) 0% 0% / 400% 400%;
|
| 402 |
+
border: none;
|
| 403 |
+
padding: 14px 28px;
|
| 404 |
+
font-size: 16px;
|
| 405 |
+
font-weight: bold;
|
| 406 |
+
color: white;
|
| 407 |
+
border-radius: 10px;
|
| 408 |
+
cursor: pointer;
|
| 409 |
+
transition: 0.3s ease-in-out;
|
| 410 |
+
animation: 2s linear 0s infinite normal none running gradientAnimation;
|
| 411 |
+
box-shadow: rgba(255, 65, 108, 0.6) 0px 4px 10px;
|
| 412 |
+
}
|
| 413 |
+
.toggle-container {
|
| 414 |
+
display: inline-flex;
|
| 415 |
+
background-color: #ffd6ff; /* light pink background */
|
| 416 |
+
border-radius: 9999px;
|
| 417 |
+
padding: 4px;
|
| 418 |
+
position: relative;
|
| 419 |
+
width: fit-content;
|
| 420 |
+
font-family: sans-serif;
|
| 421 |
+
}
|
| 422 |
+
.toggle-container input[type="radio"] {
|
| 423 |
+
display: none;
|
| 424 |
+
}
|
| 425 |
+
.toggle-container label {
|
| 426 |
+
position: relative;
|
| 427 |
+
z-index: 2;
|
| 428 |
+
flex: 1;
|
| 429 |
+
text-align: center;
|
| 430 |
+
font-weight: 700;
|
| 431 |
+
color: #4b2ab5; /* dark purple text for unselected */
|
| 432 |
+
padding: 6px 22px;
|
| 433 |
+
border-radius: 9999px;
|
| 434 |
+
cursor: pointer;
|
| 435 |
+
transition: color 0.25s ease;
|
| 436 |
+
}
|
| 437 |
+
/* Moving highlight */
|
| 438 |
+
.toggle-highlight {
|
| 439 |
+
position: absolute;
|
| 440 |
+
top: 4px;
|
| 441 |
+
left: 4px;
|
| 442 |
+
width: calc(50% - 4px);
|
| 443 |
+
height: calc(100% - 8px);
|
| 444 |
+
background-color: #4b2ab5; /* dark purple background */
|
| 445 |
+
border-radius: 9999px;
|
| 446 |
+
transition: transform 0.25s ease;
|
| 447 |
+
z-index: 1;
|
| 448 |
+
}
|
| 449 |
+
/* When "True" is checked */
|
| 450 |
+
#true:checked ~ label[for="true"] {
|
| 451 |
+
color: #ffd6ff; /* light pink text */
|
| 452 |
+
}
|
| 453 |
+
/* When "False" is checked */
|
| 454 |
+
#false:checked ~ label[for="false"] {
|
| 455 |
+
color: #ffd6ff; /* light pink text */
|
| 456 |
+
}
|
| 457 |
+
/* Move highlight to right side when False is checked */
|
| 458 |
+
#false:checked ~ .toggle-highlight {
|
| 459 |
+
transform: translateX(100%);
|
| 460 |
+
}
|
| 461 |
+
"""
|
| 462 |
+
|
| 463 |
+
with gr.Blocks(css=css, title="LTX-2 Video Distilled 🎥🔈") as demo:
|
| 464 |
gr.HTML(
|
| 465 |
"""
|
| 466 |
<div style="text-align: left;">
|
|
|
|
| 479 |
"""
|
| 480 |
)
|
| 481 |
with gr.Row():
|
| 482 |
+
with gr.Column(elem_id="col-container"):
|
| 483 |
input_image = gr.Image(
|
| 484 |
label="Input Image (Optional)",
|
| 485 |
type="pil",
|
|
|
|
| 531 |
precision=0
|
| 532 |
)
|
| 533 |
|
| 534 |
+
with gr.Column(elem_id="col-container"):
|
| 535 |
output_video = gr.Video(label="Generated Video", autoplay=True, height=512)
|
| 536 |
+
generate_btn = gr.Button("Generate Video", variant="primary", elem_classes="button-gradient")
|
| 537 |
|
| 538 |
generate_btn.click(
|
| 539 |
fn=generate_video,
|
|
|
|
| 578 |
)
|
| 579 |
|
| 580 |
|
| 581 |
+
|
|
|
|
|
|
|
| 582 |
if __name__ == "__main__":
|
| 583 |
demo.launch()
|