Emalawi19 commited on
Commit
bb5bd61
Β·
verified Β·
1 Parent(s): 9e8b146

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +31 -0
app.py ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import replicate
3
+ import os
4
+
5
+ # πŸ”‘ Set your Replicate API key (from Secrets)
6
+ os.environ["REPLICATE_API_TOKEN"] = os.getenv("r8_Cp43RsjZgsiIyKcJMxh4w8HAqGoQxvQ4MAHp4")
7
+
8
+ def generate_video(prompt):
9
+ try:
10
+ output = replicate.run(
11
+ "anotherjesse/zeroscope-v2-xl",
12
+ input={
13
+ "prompt": prompt,
14
+ "num_frames": 24,
15
+ "fps": 8
16
+ }
17
+ )
18
+ return output
19
+ except Exception as e:
20
+ return str(e)
21
+
22
+ # 🎨 Gradio UI
23
+ interface = gr.Interface(
24
+ fn=generate_video,
25
+ inputs=gr.Textbox(label="Enter your video prompt"),
26
+ outputs=gr.Video(label="Generated Video"),
27
+ title="🎬 Emalawi19 Text-to-Video AI",
28
+ description="Generate videos from text using AI"
29
+ )
30
+
31
+ interface.launch()