Spaces:
Sleeping
Sleeping
Commit
·
8969379
1
Parent(s):
3677637
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from PIL import Image
|
3 |
+
from diffusers import StableDiffusionPipeline
|
4 |
+
|
5 |
+
|
6 |
+
katz_model_path = 'maximalmargin/katz'
|
7 |
+
katz = StableDiffusionPipeline.from_pretrained(katz_model_path)
|
8 |
+
|
9 |
+
|
10 |
+
def predict(text):
|
11 |
+
image = katz(prompt = text).images[0]
|
12 |
+
return [image]
|
13 |
+
|
14 |
+
gallery = gr.Gallery(
|
15 |
+
label="Generated images", show_label=False, elem_id="gallery"
|
16 |
+
).style(height="auto")
|
17 |
+
|
18 |
+
gr.Interface(
|
19 |
+
predict,
|
20 |
+
inputs=gr.Textbox(
|
21 |
+
label="Enter your prompt",
|
22 |
+
show_label=False,
|
23 |
+
max_lines=1,
|
24 |
+
placeholder="Enter your prompt",
|
25 |
+
),
|
26 |
+
outputs=[gallery],
|
27 |
+
title="Alex Katz Portraiter",
|
28 |
+
).launch()
|