Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| from transformers import pipeline | |
| # Dictionary of available models | |
| MODELS = { | |
| "ModelScope (Text-to-Video)": "damo-vilab/modelscope-text-to-video-synthesis", | |
| "Hunyuan (if available)": "TencentARC/HunyuanVideo-I2V", | |
| "Mochi (Genmo)": "genmo/Mochi1", | |
| "Wan1.2": "Wan-AI/Wan2.1-T2V-14B" | |
| } | |
| def generate_video(prompt, model_name): | |
| try: | |
| pipe = pipeline("text-to-video", model=MODELS[model_name]) | |
| output = pipe(prompt) | |
| return output["video"] | |
| except Exception as e: | |
| return f"Error: {e}" | |
| demo = gr.Interface( | |
| fn=generate_video, | |
| inputs=[ | |
| gr.Textbox(label="Prompt"), | |
| gr.Dropdown(choices=list(MODELS.keys()), label="Choose Model") | |
| ], | |
| outputs="video", | |
| title="Text-to-Video Benchmarking Suite", | |
| description="Test prompt alignment, motion quality, and therapeutic video generation across multiple models" | |
| ) | |
| demo.launch() |