mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-07-11 08:57:22 +08:00
Fix dtype mismatch in AudioVAE.encode for bf16/fp16 audio VAE
This commit is contained in:
parent
7cf4e78335
commit
ad3797ad4f
@ -154,6 +154,10 @@ class AudioVAE(torch.nn.Module):
|
||||
waveform, waveform_sample_rate, device=waveform.device
|
||||
)
|
||||
|
||||
# Cast mel spectrogram to match encoder weight dtype (bf16 VAE + float32 audio input)
|
||||
encoder_dtype = next(self.autoencoder.encoder.parameters()).dtype
|
||||
mel_spec = mel_spec.to(dtype=encoder_dtype)
|
||||
|
||||
latents = self.autoencoder.encode(mel_spec)
|
||||
posterior = DiagonalGaussianDistribution(latents)
|
||||
latent_mode = posterior.mode()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user