Update app.py
Browse files
app.py
CHANGED
@@ -16,6 +16,21 @@ model_id = "OpenVINO/LCM_Dreamshaper_v7-int8-ov"
|
|
16 |
pipeline = OVLatentConsistencyModelPipeline.from_pretrained(model_id, compile=False)
|
17 |
|
18 |
batch_size, num_images, height, width = 1, 1, 1024, 512
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
pipeline.reshape(batch_size=batch_size, height=height, width=width, num_images_per_prompt=num_images)
|
20 |
|
21 |
#不可用lora
|
|
|
16 |
pipeline = OVLatentConsistencyModelPipeline.from_pretrained(model_id, compile=False)
|
17 |
|
18 |
batch_size, num_images, height, width = 1, 1, 1024, 512
|
19 |
+
|
20 |
+
|
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 |
+
pipeline = OVStableDiffusionPipeline.from_pretrained(model_id, compile = False, ov_config = {"CACHE_DIR":""})
|
29 |
+
|
30 |
+
taesd_dir = snapshot_download(repo_id="deinferno/taesd-openvino")
|
31 |
+
pipeline.vae_decoder = CustomOVModelVaeDecoder(model = OVBaseModel.load_model(f"{taesd_dir}/vae_decoder/openvino_model.xml"), parent_model = pipeline, model_dir = taesd_dir)
|
32 |
+
|
33 |
+
|
34 |
pipeline.reshape(batch_size=batch_size, height=height, width=width, num_images_per_prompt=num_images)
|
35 |
|
36 |
#不可用lora
|