mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-03-12 20:57:47 +08:00
Add manual cast to LTX2 vocoder conv_transpose1d (#12795)
* Add manual cast to LTX2 vocoder * Update vocoder.py
This commit is contained in:
parent
50549aa252
commit
8befce5c7b
@ -2,6 +2,7 @@ import torch
|
|||||||
import torch.nn.functional as F
|
import torch.nn.functional as F
|
||||||
import torch.nn as nn
|
import torch.nn as nn
|
||||||
import comfy.ops
|
import comfy.ops
|
||||||
|
import comfy.model_management
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import math
|
import math
|
||||||
|
|
||||||
@ -125,7 +126,7 @@ class UpSample1d(nn.Module):
|
|||||||
_, C, _ = x.shape
|
_, C, _ = x.shape
|
||||||
x = F.pad(x, (self.pad, self.pad), mode="replicate")
|
x = F.pad(x, (self.pad, self.pad), mode="replicate")
|
||||||
x = self.ratio * F.conv_transpose1d(
|
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]
|
x = x[..., self.pad_left : -self.pad_right]
|
||||||
return x
|
return x
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user