File size: 586 Bytes
424698a
 
 
bea0942
424698a
 
bea0942
 
 
 
424698a
bea0942
424698a
bea0942
 
 
 
 
424698a
 
bea0942
424698a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from diffusers import DiffusionPipeline
import gradio as gr

# Load the DiffusionPipeline
pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-video-diffusion-img2vid")

# Define the function for Gradio
def generate_image(prompt):
    image = pipe(prompt).images[0]
    return image

# Set up Gradio interface
interface = gr.Interface(
    fn=generate_image,
    inputs="text",
    outputs="image",
    title="Stable Video Diffusion Image Generator",
    description="Generate an image based on your prompt using Stable Diffusion."
)

# Launch the Gradio app
interface.launch()