sdxl-turbo / app.py
Kvikontent's picture
Create app.py
2562685 verified
raw
history blame
634 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="text",
title="Diffusion Pipeline App",
description="Enter the text to get the model's predictions on the input."
)
# Launch the Gradio interface
iface.launch()