You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[MiniMax-H3, Pika H3 Flex] ref2va fails on a reference soundtrack that is not at 32 kHz without torchaudio #15245
The ref2va setup steps of MiniMax-H3 (MiniMaxH3Ref2VASetupStep) and Pika H3 Flex (PikaH3FlexRef2VASetupStep) resample a reference soundtrack onto the audio VAE's sample rate (32 kHz) with torchaudio.transforms.Resample. torchaudio is not a diffusers dependency, so a reference soundtrack at any other rate, such as the 44.1 or 48 kHz audio track of most videos, fails with an ImportError.
Installing torchaudio is not a fix everywhere: it has no release for recent torch versions (the last on PyPI is 2.11.1).
I intend to fix this in #15199, with a plain-PyTorch port of torchaudio's default band-limited resampler.
Reproduction
In an environment without torchaudio:
importtorchfromdiffusers.modular_pipelines.minimax_h3.before_encoderimportMiniMaxH3Ref2VASetupStepwaveform=torch.randn(1, 48000*3) # 3 s of mono audio at 48 kHzMiniMaxH3Ref2VASetupStep._normalize_audio_condition(
waveform, sample_rate=48000, target_sample_rate=32000, max_duration=2.0
)
The same applies to PikaH3FlexRef2VASetupStep._normalize_audio_condition in diffusers.modular_pipelines.pika_h3_flex.before_encoder.
Logs
ImportError: Resampling a MiniMax-H3 reference soundtrack from 48000 Hz to 32000 Hz needs `torchaudio`. Pass a waveform already at the audio VAE's sample rate to do without it.
System Info
diffusers: main
torch: a version with no matching torchaudio release (> 2.11)
Activity