mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-07-11 00:47:14 +08:00
Merge ddb3bcc5c0 into b08debceca
This commit is contained in:
commit
9ed21e83dd
@ -451,6 +451,14 @@ class Qwen35VisionPatchEmbed(nn.Module):
|
|||||||
|
|
||||||
def forward(self, x):
|
def forward(self, x):
|
||||||
x = x.view(-1, self.in_channels, self.temporal_patch_size, self.patch_size, self.patch_size)
|
x = x.view(-1, self.in_channels, self.temporal_patch_size, self.patch_size, self.patch_size)
|
||||||
|
if (
|
||||||
|
comfy.model_management.is_amd()
|
||||||
|
and x.is_cuda
|
||||||
|
and x.dtype in (torch.float16, torch.bfloat16)
|
||||||
|
):
|
||||||
|
# This Conv3d is a full-patch projection, equivalent to Linear.
|
||||||
|
# Avoid the ROCm/MIOpen reduced-precision Conv3d kernel that can segfault.
|
||||||
|
return F.linear(x.flatten(1), self.proj.weight.flatten(1), self.proj.bias)
|
||||||
return self.proj(x).view(-1, self.embed_dim)
|
return self.proj(x).view(-1, self.embed_dim)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user