Skip to content

Commit 0c35ed4

Browse files
committed
up
1 parent 738f278 commit 0c35ed4

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/diffusers/models/attention_dispatch.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ def dispatch_attention_fn(
329329
else:
330330
backend_name = AttentionBackendName(backend)
331331
backend_fn = _AttentionBackendRegistry._backends.get(backend_name)
332-
332+
333333
kwargs = {
334334
"query": query,
335335
"key": key,
@@ -352,7 +352,7 @@ def dispatch_attention_fn(
352352
check(**kwargs)
353353

354354
kwargs = {k: v for k, v in kwargs.items() if k in _AttentionBackendRegistry._supported_arg_names[backend_name]}
355-
355+
356356
if "_parallel_config" in kwargs and kwargs["_parallel_config"] is not None:
357357
attention_backend = AttentionBackendName(backend_name)
358358
if not _AttentionBackendRegistry._is_context_parallel_available(attention_backend):
@@ -363,7 +363,7 @@ def dispatch_attention_fn(
363363
f"Please set a compatible attention backend: {compatible_backends} using `model.set_attention_backend()` before "
364364
f"calling `model.enable_parallelism()`."
365365
)
366-
366+
367367
return backend_fn(**kwargs)
368368

369369

src/diffusers/models/modeling_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -601,8 +601,8 @@ def set_attention_backend(self, backend: str) -> None:
601601
"""
602602
from .attention import AttentionModuleMixin
603603
from .attention_dispatch import (
604-
_AttentionBackendRegistry,
605604
AttentionBackendName,
605+
_AttentionBackendRegistry,
606606
_check_attention_backend_requirements,
607607
_maybe_download_kernel_for_backend,
608608
)
@@ -629,7 +629,7 @@ def set_attention_backend(self, backend: str) -> None:
629629
if processor is None or not hasattr(processor, "_attention_backend"):
630630
continue
631631
processor._attention_backend = backend
632-
632+
633633
# Important to set the active backend so that it propagates gracefully throughout.
634634
_AttentionBackendRegistry.set_active_backend(backend)
635635

0 commit comments

Comments
 (0)