Nodes/MTB Nodes/Audio Resample (mtb)
ComfyUI Node Runs on cloud

Audio Resample (mtb)

Change an audio clip's sample rate in ComfyUI

By melMass·Created 3 years ago·Updated about a month ago· 723
Audio Resample (mtb)
  • audio
  • resampled_audio
sample_rate16000

Half the audio errors in ComfyUI come down to one thing: the model wanted a specific sample rate and you gave it something else. Audio Resample (mtb) is the little node that fixes that - hand it an audio input and a target rate, get back the same audio at the new rate.

Sample rate is how many samples per second represent the sound. A model trained on 16 kHz speech genuinely expects 16 kHz; feed it 44.1 kHz studio audio and you'll get garbled output, wrong pitch, or an outright shape mismatch. This node is the resampler that sits between "the audio you have" and "the audio the model wants." That's it - no denoising, no trimming, no magic, just rate conversion done properly (it interpolates the waveform rather than naively dropping samples).

It ships in MTB Nodes (comfy_mtb) by melMass, a broad utility pack that grew an audio corner as audio-driven video (talking-head, lip-sync, and audio-reactive workflows) got popular in ComfyUI. If you're wiring TTS, a voice clip, or a music track into one of those graphs, resampling is almost always a step you need somewhere.

How it works

It takes the AUDIO tensor ComfyUI passes around and runs a proper resample to your target rate - the standard torchaudio-style interpolation, not a crude decimation. The number of samples changes, the duration stays the same, and the pitch stays correct. Downsampling (say 44.1 kHz → 16 kHz) loses the high frequencies above the new limit, which is expected and fine when the target model only cares about the speech band anyway.

The inputs and outputs that matter

There are only two, and one of them you'll rarely touch:

  • audio - the clip to convert. Comes from a load-audio node, a TTS node, or an upstream audio processor.
  • sample_rate - your target, in Hz. Default is 16000, which is exactly what most speech and voice-driven models want. Common targets: 16000 for speech models, 24000 for some TTS, 44100/48000 for music and general playback. Range runs 1000 to 192000.

Output is resampled_audio (AUDIO) - feed it straight into whatever node was complaining, or into a save-audio node.

The default of 16000 is a tell: this node exists mostly so people can drop their 44.1/48 kHz clips down to the 16 kHz that speech and lip-sync models expect. If you're targeting one of those, you can often just leave the default alone.

How to install it

Via ComfyUI Manager: search MTB Nodes, install, restart. Or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/melMass/comfy_mtb

then restart ComfyUI. The audio nodes lean on torchaudio, which almost always rides along with your existing PyTorch install, so there's typically nothing extra to fetch - no model files for this one.

Common issues & troubleshooting

"It's already at that rate." Resampling to the rate the clip is already at is a no-op - harmless, just pointless. If nothing sounds different, check whether the source was already at your target.

Downsampling then upsampling won't recover quality. Once you drop to 16 kHz, the high frequencies are gone; resampling back up to 48 kHz doesn't bring them back, it just interpolates. Resample once, toward the rate you actually need, rather than bouncing around.

Missing audio nodes on load. If the whole audio group didn't appear, MTB reports which of its optional nodes failed to load - open http://127.0.0.1:8188/mtb in your browser after ComfyUI starts and it'll tell you what's missing. For plain resampling, though, a normal PyTorch environment already has everything.

Categorymtb/audio

Inputs (2)

NameTypeDefaultDescription
audioAUDIO
sample_rateINT160001000–192000Target sample rate in Hz. Whisper requires 16000.

Outputs (1)

NameTypeDescription
resampled_audioAUDIO