Skip to content

Commit 71ebe40

Browse files
committed
do not fix num_heads to one in legacy mode
1 parent 8381e5e commit 71ebe40

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ldm/modules/diffusionmodules/openaimodel.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ def __init__(
464464
use_spatial_transformer=False, # custom transformer support
465465
transformer_depth=1, # custom transformer support
466466
context_dim=None, # custom transformer support
467-
n_embed=None, # custom support for prediction of discrete ids into codebook of first stage vq model
467+
n_embed=None, # custom support for prediction of discrete ids into codebook of first stage vq model
468468
legacy=True,
469469
):
470470
super().__init__()
@@ -545,7 +545,7 @@ def __init__(
545545
num_heads = ch // num_head_channels
546546
dim_head = num_head_channels
547547
if legacy:
548-
num_heads = 1
548+
#num_heads = 1
549549
dim_head = ch // num_heads if use_spatial_transformer else num_head_channels
550550
layers.append(
551551
AttentionBlock(
@@ -592,7 +592,7 @@ def __init__(
592592
num_heads = ch // num_head_channels
593593
dim_head = num_head_channels
594594
if legacy:
595-
num_heads = 1
595+
#num_heads = 1
596596
dim_head = ch // num_heads if use_spatial_transformer else num_head_channels
597597
self.middle_block = TimestepEmbedSequential(
598598
ResBlock(
@@ -646,7 +646,7 @@ def __init__(
646646
num_heads = ch // num_head_channels
647647
dim_head = num_head_channels
648648
if legacy:
649-
num_heads = 1
649+
#num_heads = 1
650650
dim_head = ch // num_heads if use_spatial_transformer else num_head_channels
651651
layers.append(
652652
AttentionBlock(

0 commit comments

Comments
 (0)