Skip to content

Commit 97f198e

Browse files
Fix qwen controlnet regression. (#10657)
1 parent bda0eb2 commit 97f198e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

comfy/ldm/qwen_image/controlnet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def forward(
4444
txt_start = round(max(((x.shape[-1] + (self.patch_size // 2)) // self.patch_size) // 2, ((x.shape[-2] + (self.patch_size // 2)) // self.patch_size) // 2))
4545
txt_ids = torch.arange(txt_start, txt_start + context.shape[1], device=x.device).reshape(1, -1, 1).repeat(x.shape[0], 1, 3)
4646
ids = torch.cat((txt_ids, img_ids), dim=1)
47-
image_rotary_emb = self.pe_embedder(ids).squeeze(1).unsqueeze(2).to(x.dtype)
47+
image_rotary_emb = self.pe_embedder(ids).to(x.dtype).contiguous()
4848
del ids, txt_ids, img_ids
4949

5050
hidden_states = self.img_in(hidden_states) + self.controlnet_x_embedder(hint)

0 commit comments

Comments
 (0)