hexanovapixel commited on
Commit
a93a71f
·
verified ·
1 Parent(s): 3515a86

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -0
app.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from diffusers import StableDiffusionPipeline
3
+
4
+ pipe = StableDiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5")
5
+ pipe = pipe.to("cpu")
6
+
7
+ def generar_imagen(prompt):
8
+ imagen = pipe(prompt).images[0]
9
+ return imagen
10
+
11
+ interfaz = gr.Interface(
12
+ fn=generar_imagen,
13
+ inputs=gr.Textbox(label="Escribe tu idea"),
14
+ outputs=gr.Image(label="Imagen generada")
15
+ )
16
+
17
+ interfaz.launch()