Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
diffusers
Commits
de16f646
Unverified
Commit
de16f646
authored
Jun 07, 2023
by
Sayak Paul
Committed by
GitHub
Jun 06, 2023
Browse files
feat: when using PT 2.0 use LoRAAttnProcessor2_0 for text enc LoRA. (#3691)
parent
017ee160
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
src/diffusers/loaders.py
src/diffusers/loaders.py
+4
-1
No files found.
src/diffusers/loaders.py
View file @
de16f646
...
@@ -1168,7 +1168,10 @@ class LoraLoaderMixin:
...
@@ -1168,7 +1168,10 @@ class LoraLoaderMixin:
cross_attention_dim
=
value_dict
[
"to_k_lora.down.weight"
].
shape
[
1
]
cross_attention_dim
=
value_dict
[
"to_k_lora.down.weight"
].
shape
[
1
]
hidden_size
=
value_dict
[
"to_k_lora.up.weight"
].
shape
[
0
]
hidden_size
=
value_dict
[
"to_k_lora.up.weight"
].
shape
[
0
]
attn_processors
[
key
]
=
LoRAAttnProcessor
(
attn_processor_class
=
(
LoRAAttnProcessor2_0
if
hasattr
(
F
,
"scaled_dot_product_attention"
)
else
LoRAAttnProcessor
)
attn_processors
[
key
]
=
attn_processor_class
(
hidden_size
=
hidden_size
,
hidden_size
=
hidden_size
,
cross_attention_dim
=
cross_attention_dim
,
cross_attention_dim
=
cross_attention_dim
,
rank
=
rank
,
rank
=
rank
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment