hsuwill000
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -4,12 +4,13 @@ from optimum.intel.openvino.modeling_diffusion import OVModelVaeDecoder, OVBaseM
|
|
4 |
from huggingface_hub import snapshot_download
|
5 |
import openvino.runtime as ov
|
6 |
from typing import Optional, Dict
|
|
|
7 |
|
8 |
model_id = "hsuwill000/AngelBreed-v4-openvino-8bit"
|
9 |
|
10 |
#只有512x512 否則一直重畫
|
11 |
HIGH = 512
|
12 |
-
WIDTH =
|
13 |
|
14 |
batch_size = -1 # Or set it to a specific positive integer if needed
|
15 |
"""
|
@@ -29,6 +30,8 @@ examples = [
|
|
29 |
"((colofrul:1.7)),((best quality)), ((masterpiece)), ((ultra-detailed)), (illustration), (detailed light), (an extremely delicate and beautiful),incredibly_absurdres,(glowing),(1girl:1.7),solo,a beautiful girl,(((cowboy shot))),standding,((Hosiery)),((beautiful off-shoulder lace-trimmed layered strapless dress+white stocking):1.25),((Belts)),(leg loops),((Hosiery)),((flower headdress)),((long white hair)),(((beautiful eyes))),BREAK,((english text)),(flower:1.35),(garden),(((border:1.75))),",
|
30 |
]
|
31 |
|
|
|
|
|
32 |
pipe = OVStableDiffusionPipeline.from_pretrained(
|
33 |
model_id,
|
34 |
compile=False,
|
@@ -59,6 +62,7 @@ negative_prompt = "Easy Negative, worst quality, low quality, normal quality, lo
|
|
59 |
def infer(prompt, negative_prompt):
|
60 |
image = pipe(
|
61 |
prompt=prompt,
|
|
|
62 |
negative_prompt=negative_prompt,
|
63 |
width=WIDTH,
|
64 |
height=HIGH,
|
|
|
4 |
from huggingface_hub import snapshot_download
|
5 |
import openvino.runtime as ov
|
6 |
from typing import Optional, Dict
|
7 |
+
from diffusers import DiffusionPipeline, EulerDiscreteScheduler, KDPM2DiscreteScheduler
|
8 |
|
9 |
model_id = "hsuwill000/AngelBreed-v4-openvino-8bit"
|
10 |
|
11 |
#只有512x512 否則一直重畫
|
12 |
HIGH = 512
|
13 |
+
WIDTH = 1024
|
14 |
|
15 |
batch_size = -1 # Or set it to a specific positive integer if needed
|
16 |
"""
|
|
|
30 |
"((colofrul:1.7)),((best quality)), ((masterpiece)), ((ultra-detailed)), (illustration), (detailed light), (an extremely delicate and beautiful),incredibly_absurdres,(glowing),(1girl:1.7),solo,a beautiful girl,(((cowboy shot))),standding,((Hosiery)),((beautiful off-shoulder lace-trimmed layered strapless dress+white stocking):1.25),((Belts)),(leg loops),((Hosiery)),((flower headdress)),((long white hair)),(((beautiful eyes))),BREAK,((english text)),(flower:1.35),(garden),(((border:1.75))),",
|
31 |
]
|
32 |
|
33 |
+
scheduler = KDPM2DiscreteScheduler.from_pretrained(model_id, subfolder="scheduler")
|
34 |
+
|
35 |
pipe = OVStableDiffusionPipeline.from_pretrained(
|
36 |
model_id,
|
37 |
compile=False,
|
|
|
62 |
def infer(prompt, negative_prompt):
|
63 |
image = pipe(
|
64 |
prompt=prompt,
|
65 |
+
scheduler=scheduler,
|
66 |
negative_prompt=negative_prompt,
|
67 |
width=WIDTH,
|
68 |
height=HIGH,
|