Spaces:
Sleeping
Sleeping
Adityahulk
commited on
Commit
Β·
80c44a9
1
Parent(s):
c648277
text changes
Browse files- streamlit_app.py +112 -20
streamlit_app.py
CHANGED
|
@@ -562,30 +562,105 @@ def generate_via_api(api_url: str, input_type: str, input_data: str, quality: st
|
|
| 562 |
# ============================================================================
|
| 563 |
|
| 564 |
with st.sidebar:
|
| 565 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 566 |
st.markdown("---")
|
| 567 |
|
| 568 |
# Show mode indicator
|
| 569 |
if DIRECT_MODE:
|
| 570 |
-
st.success("π
|
| 571 |
else:
|
| 572 |
-
st.info("π
|
| 573 |
api_url = st.text_input("API URL", value="http://localhost:8000")
|
| 574 |
|
| 575 |
-
st.markdown("### Settings")
|
| 576 |
-
|
| 577 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 578 |
|
| 579 |
st.markdown("---")
|
| 580 |
-
|
| 581 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 582 |
|
| 583 |
# ============================================================================
|
| 584 |
# Main Content
|
| 585 |
# ============================================================================
|
| 586 |
|
| 587 |
-
|
| 588 |
-
st.markdown("
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 589 |
|
| 590 |
# Input tabs
|
| 591 |
tab1, tab2, tab3 = st.tabs(["π Text / Script", "π Blog / URL", "π PDF Document"])
|
|
@@ -624,7 +699,10 @@ with tab3:
|
|
| 624 |
# Generate Button & Logic
|
| 625 |
# ============================================================================
|
| 626 |
|
| 627 |
-
|
|
|
|
|
|
|
|
|
|
| 628 |
if not input_data:
|
| 629 |
st.error("Please provide input data.")
|
| 630 |
else:
|
|
@@ -708,12 +786,26 @@ if st.button("Generate Video", type="primary", use_container_width=True):
|
|
| 708 |
# Footer
|
| 709 |
# ============================================================================
|
| 710 |
|
| 711 |
-
st.markdown("
|
| 712 |
-
|
| 713 |
-
|
| 714 |
-
|
| 715 |
-
|
| 716 |
-
|
| 717 |
-
|
| 718 |
-
|
| 719 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 562 |
# ============================================================================
|
| 563 |
|
| 564 |
with st.sidebar:
|
| 565 |
+
# Logo and branding
|
| 566 |
+
st.markdown("""
|
| 567 |
+
<div style="text-align: center; padding: 1rem 0;">
|
| 568 |
+
<h1 style="
|
| 569 |
+
background: linear-gradient(135deg, #818cf8 0%, #c084fc 50%, #f472b6 100%);
|
| 570 |
+
-webkit-background-clip: text;
|
| 571 |
+
-webkit-text-fill-color: transparent;
|
| 572 |
+
background-clip: text;
|
| 573 |
+
font-size: 2rem;
|
| 574 |
+
font-weight: 800;
|
| 575 |
+
margin: 0;
|
| 576 |
+
">β¨ Vidsimplify</h1>
|
| 577 |
+
<p style="color: #a5b4fc; font-size: 0.85rem; margin-top: 0.5rem;">
|
| 578 |
+
Precision Animations
|
| 579 |
+
</p>
|
| 580 |
+
</div>
|
| 581 |
+
""", unsafe_allow_html=True)
|
| 582 |
+
|
| 583 |
st.markdown("---")
|
| 584 |
|
| 585 |
# Show mode indicator
|
| 586 |
if DIRECT_MODE:
|
| 587 |
+
st.success("π Cloud Mode")
|
| 588 |
else:
|
| 589 |
+
st.info("π Local Development")
|
| 590 |
api_url = st.text_input("API URL", value="http://localhost:8000")
|
| 591 |
|
| 592 |
+
st.markdown("### βοΈ Settings")
|
| 593 |
+
|
| 594 |
+
# Quality - default to HIGH (index=2)
|
| 595 |
+
quality = st.selectbox(
|
| 596 |
+
"Video Quality",
|
| 597 |
+
["low", "medium", "high"],
|
| 598 |
+
index=2, # Default to HIGH
|
| 599 |
+
format_func=lambda x: {"low": "β‘ Fast (480p)", "medium": "π₯ Standard (720p)", "high": "β¨ Premium (1080p)"}[x]
|
| 600 |
+
)
|
| 601 |
+
|
| 602 |
+
# Category with better labels
|
| 603 |
+
category = st.selectbox(
|
| 604 |
+
"Animation Style",
|
| 605 |
+
["tech_system", "product_startup", "mathematical"],
|
| 606 |
+
index=0,
|
| 607 |
+
format_func=lambda x: {"tech_system": "π§ Tech & Systems", "product_startup": "π Product & Startup", "mathematical": "π Mathematical"}[x]
|
| 608 |
+
)
|
| 609 |
|
| 610 |
st.markdown("---")
|
| 611 |
+
|
| 612 |
+
# About section - professional branding
|
| 613 |
+
st.markdown("""
|
| 614 |
+
<div style="
|
| 615 |
+
background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);
|
| 616 |
+
border: 1px solid rgba(99, 102, 241, 0.2);
|
| 617 |
+
border-radius: 12px;
|
| 618 |
+
padding: 1rem;
|
| 619 |
+
margin-top: 1rem;
|
| 620 |
+
">
|
| 621 |
+
<h4 style="color: #e0e0ff; margin: 0 0 0.5rem 0; font-size: 0.9rem;">About Vidsimplify</h4>
|
| 622 |
+
<p style="color: #a5b4fc; font-size: 0.8rem; margin: 0; line-height: 1.5;">
|
| 623 |
+
Transform your idea into precision animation.
|
| 624 |
+
</p>
|
| 625 |
+
</div>
|
| 626 |
+
""", unsafe_allow_html=True)
|
| 627 |
+
|
| 628 |
+
# Footer in sidebar
|
| 629 |
+
st.markdown("""
|
| 630 |
+
<div style="
|
| 631 |
+
position: absolute;
|
| 632 |
+
bottom: 6rem;
|
| 633 |
+
left: 1rem;
|
| 634 |
+
right: 1rem;
|
| 635 |
+
text-align: center;
|
| 636 |
+
color: #6b7280;
|
| 637 |
+
font-size: 0.75rem;
|
| 638 |
+
">
|
| 639 |
+
Made with π by Vidsimplify Team
|
| 640 |
+
</div>
|
| 641 |
+
""", unsafe_allow_html=True)
|
| 642 |
|
| 643 |
# ============================================================================
|
| 644 |
# Main Content
|
| 645 |
# ============================================================================
|
| 646 |
|
| 647 |
+
# Hero section
|
| 648 |
+
st.markdown("""
|
| 649 |
+
<div style="text-align: center; margin-bottom: 2rem;">
|
| 650 |
+
<h1 style="
|
| 651 |
+
background: linear-gradient(135deg, #818cf8 0%, #c084fc 50%, #f472b6 100%);
|
| 652 |
+
-webkit-background-clip: text;
|
| 653 |
+
-webkit-text-fill-color: transparent;
|
| 654 |
+
background-clip: text;
|
| 655 |
+
font-size: 2.8rem;
|
| 656 |
+
font-weight: 800;
|
| 657 |
+
margin-bottom: 0.5rem;
|
| 658 |
+
">Create Precision Animations</h1>
|
| 659 |
+
<p style="color: #a5b4fc; font-size: 1.1rem;">
|
| 660 |
+
Transform text, blogs, and documents into beautiful animated videos
|
| 661 |
+
</p>
|
| 662 |
+
</div>
|
| 663 |
+
""", unsafe_allow_html=True)
|
| 664 |
|
| 665 |
# Input tabs
|
| 666 |
tab1, tab2, tab3 = st.tabs(["π Text / Script", "π Blog / URL", "π PDF Document"])
|
|
|
|
| 699 |
# Generate Button & Logic
|
| 700 |
# ============================================================================
|
| 701 |
|
| 702 |
+
# Add spacing before button
|
| 703 |
+
st.markdown("<br>", unsafe_allow_html=True)
|
| 704 |
+
|
| 705 |
+
if st.button("β¨ Create Animation", type="primary", use_container_width=True):
|
| 706 |
if not input_data:
|
| 707 |
st.error("Please provide input data.")
|
| 708 |
else:
|
|
|
|
| 786 |
# Footer
|
| 787 |
# ============================================================================
|
| 788 |
|
| 789 |
+
st.markdown("""
|
| 790 |
+
<div style="
|
| 791 |
+
margin-top: 3rem;
|
| 792 |
+
padding: 1.5rem 0;
|
| 793 |
+
border-top: 1px solid rgba(99, 102, 241, 0.2);
|
| 794 |
+
text-align: center;
|
| 795 |
+
">
|
| 796 |
+
<div style="display: flex; justify-content: center; align-items: center; gap: 2rem; flex-wrap: wrap;">
|
| 797 |
+
<span style="color: #6b7280; font-size: 0.85rem;">
|
| 798 |
+
β¨ <strong style="color: #a5b4fc;">Vidsimplify</strong> β Precision Animations
|
| 799 |
+
</span>
|
| 800 |
+
<span style="color: #4b5563; font-size: 0.8rem;">|</span>
|
| 801 |
+
<span style="color: #6b7280; font-size: 0.85rem;">
|
| 802 |
+
Made with π by Vidsimplify Team
|
| 803 |
+
</span>
|
| 804 |
+
<span style="color: #4b5563; font-size: 0.8rem;">|</span>
|
| 805 |
+
<span style="color: #6b7280; font-size: 0.85rem;">
|
| 806 |
+
Β© 2024 All rights reserved
|
| 807 |
+
</span>
|
| 808 |
+
</div>
|
| 809 |
+
</div>
|
| 810 |
+
""", unsafe_allow_html=True)
|
| 811 |
+
|