Spaces:
Running
Running
| import gradio as gr | |
| from diffusers import DiffusionPipeline | |
| # Load the model | |
| pipeline = DiffusionPipeline.from_pretrained("ali-vilab/text-to-video-ms-1.7b") | |
| def generate_video(text): | |
| video = pipeline(text) | |
| # Assuming the output is a video file or a binary stream. Adjust accordingly. | |
| return video | |
| # Create the Gradio interface | |
| interface = gr.Interface( | |
| fn=generate_video, | |
| inputs=gr.Textbox(lines=2, placeholder="Type your text here..."), | |
| outputs=gr.Video(), | |
| title="Text-to-Video Generator", | |
| description="Enter some text and generate a video!" | |
| ) | |
| if __name__ == "__main__": | |
| interface.launch() |