habib926653's picture
Update app.py
b6a2649 verified
import streamlit as st
st.markdown(
"""
<h1 style='text-align: center;'>⚠️ This Text-to-Video Generator is No Longer Working</h1>
<p style='text-align: center; font-size: 18px;'>
Due to changes in the inference API quota, this version can no longer generate videos.
</p>
<p style='text-align: center; font-size: 18px;'>
You can still try the improved version of this tool here:
</p>
<div style='text-align: center; margin-top: 30px;'>
<a href='https://ez-clip.ovh' target='_blank' style='padding: 12px 24px; background-color: #1d4ed8; color: white; text-decoration: none; border-radius: 6px; font-size: 16px;'>🎬 Try EzClip at ez-clip.ovh</a>
</div>
<p style='text-align: center; font-size: 14px; margin-top: 20px;'>
Feedback is always welcome.
</p>
""",
unsafe_allow_html=True
)
# import streamlit as st
# from gradio_client import Client
# import constants
# from utils import get_scenes, generate_video_assets, generate_video # Import the function from utils.py
# # Title
# st.markdown(
# "<h1 style='text-align: center;'>Text to Video Generator</h1>",
# unsafe_allow_html=True
# )
# st.markdown("<p style='text-align: center;'>Leave a Like if it works for you! ❤️</p>", unsafe_allow_html=True)
# # Text input box with a max of 1500 characters
# text_script = st.text_area("Enter your script/story (max 1500 characters):", max_chars=1500)
# # Initialize the client with the hosted model
# client = Client(constants.TTS_GRADIO_CLIENT_NAME)
# # Dropdown for language selection
# language = st.selectbox("Choose Language:", ["Urdu", "English"]) # Add more languages as needed
# # Get available speakers for the selected language
# speakers_response = client.predict(language=language, api_name="/get_speakers")
# # Extract speakers list
# speakers = [choice[0] for choice in speakers_response["choices"]]
# selected_speaker = st.selectbox("Choose Speaker:", speakers)
# # Button to trigger the processing
# if st.button("Generate Video"):
# if text_script:
# # Call the function from utils.py to process the text
# scenes = get_scenes(text_script)
# video_assets_folder = generate_video_assets(scenes, language, selected_speaker)
# generated_video_path = generate_video(video_assets_folder)
# st.video(generated_video_path)
# else:
# st.warning("Please enter some text to generate prompts.")
# st.markdown("### 🔥 See How It Works (Example)")
# # Example script in an expandable section
# with st.expander("📜 Example Script to Generate a Video"):
# st.markdown("""
# **Title:** Thirsty Crow (yep, the simplest example I came up with)
# **Script:**
# One hot summer day, a thirsty crow was flying in search of water. He looked everywhere, but he couldn't find a single drop. Tired and exhausted, he finally spotted a clay pot with a little water at the bottom.
# The crow tried to reach the water, but his beak couldn’t go deep enough. He thought hard and came up with a clever idea. He picked up small pebbles one by one and dropped them into the pot. With each pebble, the water level slowly rose higher and higher.
# Finally, after many pebbles, the water reached the top. The crow happily drank the water and flew away, refreshed and satisfied
# """)
# # Example video (Replace 'crow_example.mp4' with your actual file path or URL)
# example_video_path = "crow_example.mp4" # Change to your actual video file
# st.video(example_video_path)