ovieyra21 commited on
Commit
548acc4
·
verified ·
1 Parent(s): 8fd8396

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -2
app.py CHANGED
@@ -1,3 +1,19 @@
1
- import gradio as gr
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
- gr.load("models/ovieyra21/yebama-sd15").launch()
 
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