asd34q234 commited on
Commit
2b33c49
·
verified ·
1 Parent(s): 689bef7

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -0
app.py ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import torch
3
+ from longcat_video import LongcatVideoPipeline
4
+
5
+ pipe = LongcatVideoPipeline.from_pretrained(
6
+ "meituan-longcat/LongCat-Video",
7
+ torch_dtype=torch.float16,
8
+ device_map="auto"
9
+ )
10
+
11
+ def generate_video(prompt):
12
+ video = pipe.text_to_video(prompt)
13
+ video.save("output.mp4")
14
+ return "output.mp4"
15
+
16
+ gr.Interface(
17
+ fn=generate_video,
18
+ inputs=gr.Textbox(label="Prompt"),
19
+ outputs=gr.Video(label="Output Video"),
20
+ title="LongCat-Video Demo"
21
+ ).launch()