Spaces:
Running
Running
File size: 685 Bytes
60e8df8 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
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()
|