Spaces:
Runtime error
Runtime error
Shangkhonil
commited on
Commit
•
929c5eb
1
Parent(s):
54babe0
Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,10 @@
|
|
1 |
import gradio as gr
|
2 |
from diffusers import DiffusionPipeline
|
|
|
3 |
|
4 |
pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0")
|
5 |
-
|
|
|
6 |
|
7 |
def generate_image(prompt):
|
8 |
image = pipe(prompt).images[0]
|
@@ -17,4 +19,4 @@ with gr.Blocks() as demo:
|
|
17 |
generate_button = gr.Button("Generate")
|
18 |
|
19 |
generate_button.click(fn=generate_image, inputs=prompt, outputs=image_output)
|
20 |
-
demo.launch()
|
|
|
1 |
import gradio as gr
|
2 |
from diffusers import DiffusionPipeline
|
3 |
+
from peft import PeftModel
|
4 |
|
5 |
pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0")
|
6 |
+
|
7 |
+
pipe.unet = PeftModel.from_pretrained(pipe.unet, "SvenN/sdxl-emoji")
|
8 |
|
9 |
def generate_image(prompt):
|
10 |
image = pipe(prompt).images[0]
|
|
|
19 |
generate_button = gr.Button("Generate")
|
20 |
|
21 |
generate_button.click(fn=generate_image, inputs=prompt, outputs=image_output)
|
22 |
+
demo.launch()
|