Skip to content

Commit 8befce5

Browse files
authored
Add manual cast to LTX2 vocoder conv_transpose1d (#12795)
* Add manual cast to LTX2 vocoder * Update vocoder.py
1 parent 50549aa commit 8befce5

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

comfy/ldm/lightricks/vocoders/vocoder.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import torch.nn.functional as F
33
import torch.nn as nn
44
import comfy.ops
5+
import comfy.model_management
56
import numpy as np
67
import math
78

@@ -125,7 +126,7 @@ def forward(self, x):
125126
_, C, _ = x.shape
126127
x = F.pad(x, (self.pad, self.pad), mode="replicate")
127128
x = self.ratio * F.conv_transpose1d(
128-
x, self.filter.expand(C, -1, -1), stride=self.stride, groups=C
129+
x, comfy.model_management.cast_to(self.filter.expand(C, -1, -1), dtype=x.dtype, device=x.device), stride=self.stride, groups=C
129130
)
130131
x = x[..., self.pad_left : -self.pad_right]
131132
return x

0 commit comments

Comments
 (0)