Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -13,25 +13,27 @@ model_id = "Disty0/SoteMixV3"
|
|
13 |
#model_id = "Disty0/sotediffusion-v2" #不可
|
14 |
|
15 |
#1024*512 記憶體不足 1024x1536
|
16 |
-
HIGH=
|
17 |
-
WIDTH=
|
18 |
|
19 |
|
20 |
batch_size = -1
|
21 |
-
class CustomOVModelVaeDecoder(OVModelVaeDecoder):
|
22 |
-
def __init__(
|
23 |
-
self, model: ov.Model, parent_model: OVBaseModel, ov_config: Optional[Dict[str, str]] = None, model_dir: str = None,
|
24 |
-
):
|
25 |
-
super(OVModelVaeDecoder, self).__init__(model, parent_model, ov_config, "vae_decoder", model_dir)
|
26 |
|
27 |
|
28 |
-
pipe = OVStableDiffusionPipeline.from_pretrained(model_id
|
|
|
29 |
|
30 |
#有taesd很醜
|
31 |
#taesd_dir = snapshot_download(repo_id="deinferno/taesd-openvino")
|
32 |
#pipe.vae_decoder = CustomOVModelVaeDecoder(model = OVBaseModel.load_model(f"{taesd_dir}/vae_decoder/openvino_model.xml"), parent_model = pipe, model_dir = taesd_dir)
|
33 |
|
34 |
-
pipe.reshape( batch_size=-1, height=HIGH, width=WIDTH, num_images_per_prompt=1)
|
|
|
35 |
#pipe.load_textual_inversion("./badhandv4.pt", "badhandv4")
|
36 |
#pipe.load_textual_inversion("./Konpeto.pt", "Konpeto")
|
37 |
#<shigure-ui-style>
|
@@ -40,7 +42,7 @@ pipe.reshape( batch_size=-1, height=HIGH, width=WIDTH, num_images_per_prompt=1)
|
|
40 |
#pipe.load_textual_inversion("sd-concepts-library/agm-style-nao")
|
41 |
|
42 |
|
43 |
-
pipe.compile()
|
44 |
|
45 |
prompt=""
|
46 |
negative_prompt="(worst quality, low quality, lowres), zombie, interlocked fingers,"
|
@@ -80,7 +82,7 @@ with gr.Blocks(css=css) as demo:
|
|
80 |
|
81 |
with gr.Column(elem_id="col-container"):
|
82 |
gr.Markdown(f"""
|
83 |
-
# Disty0/SoteMixV3 {HIGH}x{WIDTH}
|
84 |
Currently running on {power_device}.
|
85 |
""")
|
86 |
|
|
|
13 |
#model_id = "Disty0/sotediffusion-v2" #不可
|
14 |
|
15 |
#1024*512 記憶體不足 1024x1536
|
16 |
+
HIGH=512
|
17 |
+
WIDTH=512
|
18 |
|
19 |
|
20 |
batch_size = -1
|
21 |
+
#class CustomOVModelVaeDecoder(OVModelVaeDecoder):
|
22 |
+
# def __init__(
|
23 |
+
# self, model: ov.Model, parent_model: OVBaseModel, ov_config: Optional[Dict[str, str]] = None, model_dir: str = None,
|
24 |
+
# ):
|
25 |
+
# super(OVModelVaeDecoder, self).__init__(model, parent_model, ov_config, "vae_decoder", model_dir)
|
26 |
|
27 |
|
28 |
+
pipe = OVStableDiffusionPipeline.from_pretrained(model_id)
|
29 |
+
#pipe = OVStableDiffusionPipeline.from_pretrained(model_id, compile = False, ov_config = {"CACHE_DIR":""})
|
30 |
|
31 |
#有taesd很醜
|
32 |
#taesd_dir = snapshot_download(repo_id="deinferno/taesd-openvino")
|
33 |
#pipe.vae_decoder = CustomOVModelVaeDecoder(model = OVBaseModel.load_model(f"{taesd_dir}/vae_decoder/openvino_model.xml"), parent_model = pipe, model_dir = taesd_dir)
|
34 |
|
35 |
+
#pipe.reshape( batch_size=-1, height=HIGH, width=WIDTH, num_images_per_prompt=1)
|
36 |
+
|
37 |
#pipe.load_textual_inversion("./badhandv4.pt", "badhandv4")
|
38 |
#pipe.load_textual_inversion("./Konpeto.pt", "Konpeto")
|
39 |
#<shigure-ui-style>
|
|
|
42 |
#pipe.load_textual_inversion("sd-concepts-library/agm-style-nao")
|
43 |
|
44 |
|
45 |
+
#pipe.compile()
|
46 |
|
47 |
prompt=""
|
48 |
negative_prompt="(worst quality, low quality, lowres), zombie, interlocked fingers,"
|
|
|
82 |
|
83 |
with gr.Column(elem_id="col-container"):
|
84 |
gr.Markdown(f"""
|
85 |
+
# 不符合預期圖片, Disty0/SoteMixV3 {HIGH}x{WIDTH}
|
86 |
Currently running on {power_device}.
|
87 |
""")
|
88 |
|