Spaces:
Build error
Build error
Commit
·
17ab53b
1
Parent(s):
39f951c
Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,7 @@ from optimum.intel.openvino import OVStableDiffusionPipeline
|
|
3 |
from diffusers.training_utils import set_seed
|
4 |
|
5 |
quantized_pipe = OVStableDiffusionPipeline.from_pretrained("OpenVINO/Stable-Diffusion-Pokemon-en-quantized", compile=False)
|
6 |
-
quantized_pipe.reshape(batch_size=1, height=
|
7 |
quantized_pipe.compile()
|
8 |
|
9 |
prompt = "cartoon bird"
|
@@ -12,14 +12,19 @@ def generate(image):
|
|
12 |
output = quantized_pipe(prompt, num_inference_steps=50, output_type="pil")
|
13 |
return output.images[0]
|
14 |
|
|
|
|
|
|
|
|
|
15 |
gr.Interface(
|
16 |
fn=generate,
|
17 |
inputs=gr.inputs.Textbox(placeholder="cartoon bird",
|
18 |
-
label="Prompt"
|
19 |
-
"query",
|
20 |
lines=1),
|
21 |
outputs=gr.outputs.Image(type="pil", label="Generated Image"),
|
22 |
-
title="
|
23 |
description="",
|
|
|
|
|
24 |
theme="huggingface",
|
25 |
).launch()
|
|
|
3 |
from diffusers.training_utils import set_seed
|
4 |
|
5 |
quantized_pipe = OVStableDiffusionPipeline.from_pretrained("OpenVINO/Stable-Diffusion-Pokemon-en-quantized", compile=False)
|
6 |
+
quantized_pipe.reshape(batch_size=1, height=256, width=256, num_images_per_prompt=1)
|
7 |
quantized_pipe.compile()
|
8 |
|
9 |
prompt = "cartoon bird"
|
|
|
12 |
output = quantized_pipe(prompt, num_inference_steps=50, output_type="pil")
|
13 |
return output.images[0]
|
14 |
|
15 |
+
examples = ["cartoon bird",
|
16 |
+
"a drawing of a green pokemon with red eyes",
|
17 |
+
"plant pokemon in jungle"]
|
18 |
+
|
19 |
gr.Interface(
|
20 |
fn=generate,
|
21 |
inputs=gr.inputs.Textbox(placeholder="cartoon bird",
|
22 |
+
label="Prompt",
|
|
|
23 |
lines=1),
|
24 |
outputs=gr.outputs.Image(type="pil", label="Generated Image"),
|
25 |
+
title="OpenVINO-optimized Stable Diffusion",
|
26 |
description="",
|
27 |
+
verbose=True,
|
28 |
+
examples=examples,
|
29 |
theme="huggingface",
|
30 |
).launch()
|