Spaces:
Runtime error
Runtime error
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() | |