Image_Generator / app.py
AyushDey's picture
Create app.py
f106518
raw
history blame
526 Bytes
import gradio as gr
from transformers import pipeline
pipe = DiffusionPipeline.from_pretrained('runwayml/stable-diffusion-v1-5')
def imagen(prompt):
return pipe(prompt).images[0]
a = gr.Interface(fn=imagen, inputs=[gr.Textbox(label="Enter prompt for an image")],
outputs=[gr.Image(label='Generated Image')],
title='Image Generation Using Stable Diffusion',
examples=["the spirit of a tamagotchi wandering in the city of Vienna","a mecha robot in a favela"])
a.launch()