Skip to content

Commit 1900e51

Browse files
Fix potential issue.
1 parent 276f8fc commit 1900e51

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

comfy/ldm/modules/attention.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -625,15 +625,15 @@ def forward(self, x, context=None, transformer_options={}):
625625
x = self.norm(x)
626626
if not self.use_linear:
627627
x = self.proj_in(x)
628-
x = x.movedim(1, -1).flatten(1, 2).contiguous()
628+
x = x.movedim(1, 3).flatten(1, 2).contiguous()
629629
if self.use_linear:
630630
x = self.proj_in(x)
631631
for i, block in enumerate(self.transformer_blocks):
632632
transformer_options["block_index"] = i
633633
x = block(x, context=context[i], transformer_options=transformer_options)
634634
if self.use_linear:
635635
x = self.proj_out(x)
636-
x = x.reshape(x.shape[0], h, w, x.shape[-1]).movedim(-1, 1).contiguous()
636+
x = x.reshape(x.shape[0], h, w, x.shape[-1]).movedim(3, 1).contiguous()
637637
if not self.use_linear:
638638
x = self.proj_out(x)
639639
return x + x_in

0 commit comments

Comments
 (0)