File size: 744 Bytes
554ba33
cf1ee3b
554ba33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cf1ee3b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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()