ovieyra21 commited on
Commit
298abc3
1 Parent(s): 548acc4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -1,19 +1,19 @@
1
- import spaces
2
  from diffusers import DiffusionPipeline
3
 
4
- pipe = DiffusionPipeline.from_pretrained("stable-diffusion-v1-5/stable-diffusion-v1-5")
 
5
  pipe.load_lora_weights("ovieyra21/yebama-sd15")
6
  pipe.to('cuda')
7
 
8
- @spaces.GPU
9
- prompt = "yebama"
10
- image = pipe(prompt).images[0]
11
  def generate(prompt):
12
- return pipe(prompt).images
 
 
13
 
 
14
  gr.Interface(
15
  fn=generate,
16
- inputs=gr.Text(),
17
- outputs=gr.Gallery(),
18
  ).launch()
19
-
 
1
+ import gradio as gr
2
  from diffusers import DiffusionPipeline
3
 
4
+ # Cargar el modelo
5
+ pipe = DiffusionPipeline.from_pretrained("stable-diffusion-v1-5")
6
  pipe.load_lora_weights("ovieyra21/yebama-sd15")
7
  pipe.to('cuda')
8
 
 
 
 
9
  def generate(prompt):
10
+ # Generar la imagen
11
+ image = pipe(prompt).images[0]
12
+ return image
13
 
14
+ # Crear la interfaz de Gradio
15
  gr.Interface(
16
  fn=generate,
17
+ inputs=gr.Textbox(label="Escribe tu prompt"),
18
+ outputs=gr.Image(type="pil"),
19
  ).launch()