OpenVINO add experimental support for Text Encoder compiling

This commit is contained in:
Disty0
2024-01-06 01:37:04 +03:00
parent 3b14e1e70e
commit f3cebcb9dd
6 changed files with 55 additions and 23 deletions
+1 -5
View File
@@ -48,13 +48,9 @@ def full_vae_decode(latents, model):
model.upcast_vae()
latents = latents.to(next(iter(model.vae.post_quant_conv.parameters())).dtype)
# OpenVINO with INT4 doesn't work with VAE decode so we pass that we are using VAE right now to OpenVINO
if shared.opts.cuda_compile and shared.opts.cuda_compile_backend == "openvino_fx" and shared.compiled_model_state.first_pass_vae:
shared.compiled_model_state.compiling_vae = True
decoded = model.vae.decode(latents / model.vae.config.scaling_factor, return_dict=False)[0]
# Downcast VAE after OpenVINO compile
# Delete PyTorch VAE after OpenVINO compile
if shared.opts.cuda_compile and shared.opts.cuda_compile_backend == "openvino_fx" and shared.compiled_model_state.first_pass_vae:
shared.compiled_model_state.first_pass_vae = False
if hasattr(shared.sd_model, "vae"):