Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
renzhc
diffusers_dcu
Commits
bb2c64a0
Unverified
Commit
bb2c64a0
authored
Nov 24, 2022
by
Anton Lozhkov
Committed by
GitHub
Nov 24, 2022
Browse files
Add the new SD2 attention params to the VD text unet (#1400)
parent
05a36d5c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
src/diffusers/pipelines/versatile_diffusion/modeling_text_unet.py
...users/pipelines/versatile_diffusion/modeling_text_unet.py
+12
-2
No files found.
src/diffusers/pipelines/versatile_diffusion/modeling_text_unet.py
View file @
bb2c64a0
...
...
@@ -28,7 +28,9 @@ def get_down_block(
resnet_groups
=
None
,
cross_attention_dim
=
None
,
downsample_padding
=
None
,
dual_cross_attention
=
None
,
dual_cross_attention
=
False
,
use_linear_projection
=
False
,
only_cross_attention
=
False
,
):
down_block_type
=
down_block_type
[
7
:]
if
down_block_type
.
startswith
(
"UNetRes"
)
else
down_block_type
if
down_block_type
==
"DownBlockFlat"
:
...
...
@@ -58,6 +60,9 @@ def get_down_block(
downsample_padding
=
downsample_padding
,
cross_attention_dim
=
cross_attention_dim
,
attn_num_head_channels
=
attn_num_head_channels
,
dual_cross_attention
=
dual_cross_attention
,
use_linear_projection
=
use_linear_projection
,
only_cross_attention
=
only_cross_attention
,
)
raise
ValueError
(
f
"
{
down_block_type
}
is not supported."
)
...
...
@@ -75,7 +80,9 @@ def get_up_block(
attn_num_head_channels
,
resnet_groups
=
None
,
cross_attention_dim
=
None
,
dual_cross_attention
=
None
,
dual_cross_attention
=
False
,
use_linear_projection
=
False
,
only_cross_attention
=
False
,
):
up_block_type
=
up_block_type
[
7
:]
if
up_block_type
.
startswith
(
"UNetRes"
)
else
up_block_type
if
up_block_type
==
"UpBlockFlat"
:
...
...
@@ -105,6 +112,9 @@ def get_up_block(
resnet_groups
=
resnet_groups
,
cross_attention_dim
=
cross_attention_dim
,
attn_num_head_channels
=
attn_num_head_channels
,
dual_cross_attention
=
dual_cross_attention
,
use_linear_projection
=
use_linear_projection
,
only_cross_attention
=
only_cross_attention
,
)
raise
ValueError
(
f
"
{
up_block_type
}
is not supported."
)
...
...
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