AyushDey commited on
Commit
f106518
1 Parent(s): d5f9d82

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -0
app.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ pipe = DiffusionPipeline.from_pretrained('runwayml/stable-diffusion-v1-5')
5
+
6
+ def imagen(prompt):
7
+ return pipe(prompt).images[0]
8
+ a = gr.Interface(fn=imagen, inputs=[gr.Textbox(label="Enter prompt for an image")],
9
+ outputs=[gr.Image(label='Generated Image')],
10
+ title='Image Generation Using Stable Diffusion',
11
+ examples=["the spirit of a tamagotchi wandering in the city of Vienna","a mecha robot in a favela"])
12
+ a.launch()