Spaces:
Runtime error
Runtime error
import gradio as gr | |
import torch | |
from diffusers import TextToVideoPipeline | |
pipeline = TextToVideoPipeline.from_pretrained("Skywork/SkyReels-V2-DF-1.3B-540P", torch_dtype=torch.float16) | |
pipeline = pipeline.to("cuda") | |
def generate_video(prompt): | |
video_frames = pipeline(prompt, num_inference_steps=25).frames | |
return video_frames | |
interface = gr.Interface( | |
fn=generate_video, | |
inputs=gr.Textbox(lines=2, placeholder="Enter your prompt here..."), | |
outputs=gr.Video(), | |
title="Text to Video Generator", | |
description="Generate video from text prompt" | |
) | |
interface.launch() | |