Skip to content

Commit ace53e2

Browse files
committed
update/refactor
1 parent ffc2992 commit ace53e2

File tree

5 files changed

+970
-474
lines changed

5 files changed

+970
-474
lines changed

src/diffusers/guider.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,9 +351,13 @@ def set_guider(self, pipeline, guider_kwargs: Dict[str, Any]):
351351
)
352352

353353
def reset_guider(self, pipeline):
354-
if self.do_perturbed_attention_guidance:
354+
if (
355+
self.do_perturbed_attention_guidance
356+
and hasattr(self, "original_attn_proc")
357+
and self.original_attn_proc is not None
358+
):
355359
pipeline.unet.set_attn_processor(self.original_attn_proc)
356-
pipeline.original_attn_proc = None
360+
self.original_attn_proc = None
357361

358362
def maybe_update_guider(self, pipeline, timestep):
359363
pass

0 commit comments

Comments
 (0)