Re-apply attention if attention method changes

This commit is contained in:
Disty0
2024-05-11 00:05:22 +03:00
parent d1b0cd61b3
commit 8cddaa5723
2 changed files with 44 additions and 28 deletions
+3
View File
@@ -389,6 +389,9 @@ def process_diffusers(p: processing.StableDiffusionProcessing):
sd_model = preprocess_onnx_pipeline(p)
nonlocal orig_pipeline
orig_pipeline = sd_model # processed ONNX pipeline should not be replaced with original pipeline.
if getattr(sd_model, "current_attn_name", None) != shared.opts.cross_attention_optimization:
shared.log.info(f"Setting attention optimization: {shared.opts.cross_attention_optimization}")
sd_models.set_diffusers_attention(sd_model)
return sd_model
def apply_hidiffusion():