Spaces:
Runtime error
Delete app.py
import gradio as gr
from diffusers import DiffusionPipeline
import torch
Load the model
model_id = "damo-vilab/text-to-video-ms-1.7b"
pipe = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16, variant="fp16")
pipe.to("cuda" if torch.cuda.is_available() else "cpu")
Custom UI
title = "🎬 MR_EDITERR AI Video Maker"
description = """
Create your own AI-generated videos from text prompts — free and easy!
Type any idea (like “a futuristic city at sunset”) and click Generate Video.
"""
def make_video(prompt):
video_frames = pipe(prompt, num_inference_steps=25).frames
video_path = "output.mp4"
import imageio
imageio.mimsave(video_path, video_frames, fps=8)
return video_path
gr.Interface(
fn=make_video,
inputs=gr.Textbox(label="Enter your video idea:", placeholder="e.g. A rabbit jumping in the forest"),
outputs=gr.Video(label="Generated AI Video"),
title=title,
description=description,
theme="gradio/soft",
examples=[
["A rabbit running through a green forest in cinematic style"],
["A futuristic robot walking in neon lights"],
["A car driving through the desert at sunset"]
]
).launch()