image-video / app.py
shaaravpawar's picture
Update app.py
7c03e10 verified
raw
history blame
601 Bytes
import gradio as gr
from diffusion import DiffusionPipeline
# Load the pre-trained Diffusion model from Hugging Face
pipeline = DiffusionPipeline.from_pretrained("THUDM/CogVideoX-5b-I2V")
def generate_image(prompt):
image = pipeline(prompt)["sample"][0]
return image
iface = gr.Interface(
fn=generate_image,
inputs=gr.Textbox(label="Enter your prompt"),
outputs=gr.Image(type="pil"),
title="Diffusion Model Image Generator",
description="Enter a prompt to generate an image using the DiffusionPipeline from Hugging Face."
)
if __name__ == "__main__":
iface.launch()