hsuwill000
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ import torch
|
|
7 |
from huggingface_hub import snapshot_download
|
8 |
import openvino.runtime as ov
|
9 |
from typing import Optional, Dict
|
10 |
-
|
11 |
|
12 |
#LCMScheduler 產生垃圾
|
13 |
#EulerDiscreteScheduler 尚可
|
@@ -37,7 +37,7 @@ pipe = OVStableDiffusionPipeline.from_pretrained(
|
|
37 |
use_safetensors=False,
|
38 |
)
|
39 |
print(pipe.scheduler.compatibles)
|
40 |
-
|
41 |
#pipe.scheduler = LCMScheduler.from_config(pipe.scheduler.config)
|
42 |
|
43 |
#pipe.load_lora_weights(adapter_id)
|
@@ -65,8 +65,8 @@ def infer(prompt,negative_prompt):
|
|
65 |
negative_prompt = negative_prompt,
|
66 |
width = WIDTH,
|
67 |
height = HIGH,
|
68 |
-
guidance_scale=
|
69 |
-
num_inference_steps=
|
70 |
num_images_per_prompt=1,
|
71 |
).images[0]
|
72 |
|
@@ -94,7 +94,7 @@ with gr.Blocks(css=css) as demo:
|
|
94 |
|
95 |
with gr.Column(elem_id="col-container"):
|
96 |
gr.Markdown(f"""
|
97 |
-
#
|
98 |
Currently running on {power_device}.
|
99 |
""")
|
100 |
|
|
|
7 |
from huggingface_hub import snapshot_download
|
8 |
import openvino.runtime as ov
|
9 |
from typing import Optional, Dict
|
10 |
+
from diffusers import EulerAncestralDiscreteScheduler, LCMScheduler
|
11 |
|
12 |
#LCMScheduler 產生垃圾
|
13 |
#EulerDiscreteScheduler 尚可
|
|
|
37 |
use_safetensors=False,
|
38 |
)
|
39 |
print(pipe.scheduler.compatibles)
|
40 |
+
pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
|
41 |
#pipe.scheduler = LCMScheduler.from_config(pipe.scheduler.config)
|
42 |
|
43 |
#pipe.load_lora_weights(adapter_id)
|
|
|
65 |
negative_prompt = negative_prompt,
|
66 |
width = WIDTH,
|
67 |
height = HIGH,
|
68 |
+
guidance_scale=7.5,
|
69 |
+
num_inference_steps=30,
|
70 |
num_images_per_prompt=1,
|
71 |
).images[0]
|
72 |
|
|
|
94 |
|
95 |
with gr.Column(elem_id="col-container"):
|
96 |
gr.Markdown(f"""
|
97 |
+
# Koji_v2.1_diffusers-openvino {WIDTH}x{HIGH}
|
98 |
Currently running on {power_device}.
|
99 |
""")
|
100 |
|