File size: 684 Bytes
f4dbd35
007653c
181c481
007653c
181c481
 
f4dbd35
181c481
 
a780cef
181c481
f4dbd35
181c481
 
a780cef
181c481
 
f4dbd35
181c481
 
 
 
f4dbd35
cb78791
181c481
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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()