mirror of
https://github.com/vladmandic/automatic
synced 2026-09-07 21:40:46 +02:00
fix(processing): re-apply attention when the overrides change
The generate-time gate compared the stored processor name against the sdp_overrides list, which can never be equal, so the check reduced to the processor name alone and a changed override set was never applied until the next model load. set_diffusers_attention now stamps the override set it applied beside the processor name, the gate compares both, and pipe switches carry the new attribute with the old one.
This commit is contained in:
@@ -546,8 +546,9 @@ def update_pipeline(sd_model, p: processing.StableDiffusionProcessing):
|
||||
global orig_pipeline # pylint: disable=global-statement
|
||||
orig_pipeline = updated_model # processed ONNX pipeline should not be replaced with original pipeline.
|
||||
current_attn = getattr(updated_model, "current_attn_name", None)
|
||||
if (current_attn != shared.opts.cross_attention_optimization) and (current_attn != shared.opts.sdp_overrides):
|
||||
log.info(f"Setting attention optimization: {shared.opts.cross_attention_optimization}")
|
||||
current_overrides = getattr(updated_model, "current_attn_overrides", None)
|
||||
if current_attn != shared.opts.cross_attention_optimization or current_overrides != list(shared.opts.sdp_overrides):
|
||||
log.info(f"Setting attention optimization: {shared.opts.cross_attention_optimization} overrides={shared.opts.sdp_overrides}")
|
||||
attention.set_diffusers_attention(updated_model)
|
||||
return updated_model
|
||||
|
||||
|
||||
Reference in New Issue
Block a user