Audio → Tensor
The glue node that makes MuseTalk finally accept ComfyUI audio
- audio
- audio_tensor
- audio_dur
You've loaded an audio file with ComfyUI's native LoadAudio, dragged the wire toward a MuseTalk-KJ or VoiceCraft node, and nothing connects. The sockets won't mate because they speak different languages: ComfyUI's AUDIO type is a dict - {"waveform": tensor, "sample_rate": int} - while MuseTalk's pipeline expects VCAUDIOTENSOR, a raw torch tensor. That mismatch is exactly the gap Audio → Tensor (class AudioToTensor) exists to close.
It's from RyanHolanda/ComfyUI-AudioBridge, a two-node pack that's nothing but the conversion. No models to download, no API key, no VideoHelperSuite required - the README calls that out on purpose, because the usual workaround for audio plumbing is to haul in VHS and fight its VHS_AUDIO convention instead. This pack skips all of it.
How it works
The node reads the AUDIO dict, squeezes off the batch dimension, and averages any multi-channel waveform down to mono. If the audio's sample rate doesn't match your target, it resamples with torchaudio.functional.resample. What comes out the other side is a plain (channels, samples) tensor at the rate you asked for. Read the source and it's about fifteen lines - this is a utility, not a mystery.
The inputs and outputs that matter
There are only two inputs, and you'll almost never touch one of them:
- audio (
AUDIO) - whatever yourLoadAudioor other audio node hands you. - target_sample_rate (
INT, default16000, range 8000–48000) - the author's own tooltip nails it: "16000 for Whisper/MuseTalk." Whisper-based transcription and MuseTalk's audio features are built around 16 kHz, so the default is right for nearly every real use. Leave it alone unless you know the downstream node wants something else.
Outputs:
- audio_tensor (
VCAUDIOTENSOR) - the raw mono waveform tensor, wired into MuseTalk-KJ's sampler,whisper_to_features, or any node expecting raw audio. - audio_dur (
INT) - duration in whole seconds. It'sint(samples / sample_rate), so it truncates. A 0.4-second clip reports0. Not a bug, just coarse - don't panic if it looks short.
Installing it
ComfyUI Manager is the easy route: open Manager, search ComfyUI-AudioBridge, install, restart. Or go manual:
cd ComfyUI/custom_nodes
git clone https://github.com/RyanHolanda/ComfyUI-AudioBridge.git
Then restart ComfyUI. That's the whole install - the pack's requirements.txt lists only torchaudio, which ComfyUI already ships, so there's no dependency hunting to do.
Where people get burned
Two honest gotchas, both by design. First, this node downmixes to mono. Stereo stays stereo going into the graph but comes out summed to one channel - fine for talking-head pipelines, wrong if you're doing music work. Second, remember the direction: this is the into bridge. When you want your processed audio back in normal ComfyUI land, you need the pack's other node, Tensor → Audio. If your MuseTalk workflow still won't connect after this, the missing piece is usually that return trip.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| audio | AUDIO | — | |
| target_sample_rate | INT | 160008000–48000 | Target sample rate in Hz. 16000 for Whisper/MuseTalk. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| audio_tensor | VCAUDIOTENSOR | — |
| audio_dur | INT | — |