Aliashraf's picture
Update app.py
cf1ee3b verified
raw
history blame contribute delete
744 Bytes
import gradio as gr
from requisites import generate_speech, create_video
def process_text(script):
"""Process text to generate an AI video."""
if not script.strip():
return "Error: No text provided!"
# Generate AI voice
audio_file = generate_speech(script)
# Generate video with AI voice
video_file = create_video(script, audio_file)
return video_file
# Gradio UI
iface = gr.Interface(
fn=process_text,
inputs=gr.Textbox(label="Enter script for AI video"),
outputs=gr.Video(label="Generated AI Video"),
title="AI Script-to-Video Generator",
description="Enter a script, and AI will generate a voiceover + video with text."
)
# Run app
if __name__ == "__main__":
iface.launch()