Add manual cast to LTX2 vocoder conv_transpose1d (#12795)

* Add manual cast to LTX2 vocoder

* Update vocoder.py
This commit is contained in:
Jukka Seppänen
2026-03-05 22:37:25 +02:00
committed by GitHub
parent 50549aa252
commit 8befce5c7b

View File

@@ -2,6 +2,7 @@ import torch
import torch.nn.functional as F
import torch.nn as nn
import comfy.ops
import comfy.model_management
import numpy as np
import math
@@ -125,7 +126,7 @@ class UpSample1d(nn.Module):
_, C, _ = x.shape
x = F.pad(x, (self.pad, self.pad), mode="replicate")
x = self.ratio * F.conv_transpose1d(
x, self.filter.expand(C, -1, -1), stride=self.stride, groups=C
x, comfy.model_management.cast_to(self.filter.expand(C, -1, -1), dtype=x.dtype, device=x.device), stride=self.stride, groups=C
)
x = x[..., self.pad_left : -self.pad_right]
return x