sdxl-turbo / app.py
Kvikontent's picture
Update app.py
2daab00 verified
raw
history blame contribute delete
678 Bytes
import gradio as gr
from diffusers import DiffusionPipeline
# Load the pretrained model
pipeline = DiffusionPipeline.from_pretrained("stabilityai/sdxl-turbo")
# Define a function to use the model for prediction
def predict(text_input):
# Use the pipeline to make predictions
output = pipeline(text_input)
return output
# Create a Gradio interface
iface = gr.Interface(
fn=predict,
inputs=gr.Textbox(lines=5, label="Input Text"),
outputs=gr.Image(type="numpy", label="Output Image"),
title="Diffusion Pipeline App",
description="Enter the text to get the model's predictions as an output image."
)
# Launch the Gradio interface
iface.launch()