Spaces:
Running
Running
import gradio as gr | |
from diffusers import DiffusionPipeline | |
# Load the pre-trained model pipeline | |
pipe = DiffusionPipeline.from_pretrained("ImageInception/ArtifyAI") | |
# Define a function to generate the image based on user input text | |
def generate_image(prompt): | |
# Generate the image from the prompt | |
image = pipe(prompt).images[0] | |
return image | |
# Define the Gradio interface | |
iface = gr.Interface( | |
fn=generate_image, | |
inputs="text", | |
outputs="image", | |
title="ArtifyAI Generator", | |
description="Enter a prompt and generate an image using the ArtifyAI model." | |
) | |
# Launch the Gradio app | |
if __name__ == "__main__": | |
iface.launch() | |