Runwaymlfaiz / app.py
Faizbulbul's picture
Update app.py
181c481 verified
raw
history blame
684 Bytes
import gradio as gr
from diffusers import StableVideoDiffusionPipeline
import torch
# Model Load करो (CPU के लिए)
pipe = StableVideoDiffusionPipeline.from_pretrained(
"stabilityai/stable-video-diffusion-img2vid",
torch_dtype=torch.float32
)
# Function जो Image से Video Generate करेगा
def generate_video(image):
video = pipe(image).frames
return video
# Gradio Interface बनाओ
iface = gr.Interface(
fn=generate_video,
inputs=gr.Image(label="Upload an image"),
outputs=gr.Video(label="Generated Video"),
title="AI Video Generator",
description="Upload an image to generate an AI video."
)
iface.launch()