Spaces:
Runtime error
Runtime error
Create app.py
Browse files
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()
|