mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-26 19:19:53 +00:00
Convert mono audio to fake stereo for LTXV VAE encoding (#11965)
This commit is contained in:
@@ -189,9 +189,12 @@ class AudioVAE(torch.nn.Module):
|
|||||||
waveform = self.device_manager.move_to_load_device(waveform)
|
waveform = self.device_manager.move_to_load_device(waveform)
|
||||||
expected_channels = self.autoencoder.encoder.in_channels
|
expected_channels = self.autoencoder.encoder.in_channels
|
||||||
if waveform.shape[1] != expected_channels:
|
if waveform.shape[1] != expected_channels:
|
||||||
raise ValueError(
|
if waveform.shape[1] == 1:
|
||||||
f"Input audio must have {expected_channels} channels, got {waveform.shape[1]}"
|
waveform = waveform.expand(-1, expected_channels, *waveform.shape[2:])
|
||||||
)
|
else:
|
||||||
|
raise ValueError(
|
||||||
|
f"Input audio must have {expected_channels} channels, got {waveform.shape[1]}"
|
||||||
|
)
|
||||||
|
|
||||||
mel_spec = self.preprocessor.waveform_to_mel(
|
mel_spec = self.preprocessor.waveform_to_mel(
|
||||||
waveform, waveform_sample_rate, device=self.device_manager.load_device
|
waveform, waveform_sample_rate, device=self.device_manager.load_device
|
||||||
|
|||||||
Reference in New Issue
Block a user