Nodes/Audio Batch/Audio Channel Conv and Resampler
ComfyUI Node

Audio Channel Conv and Resampler

Audio Channel Conv and Resampler — both fixes, one node, zero chaining

By set-soft·Created about a year ago·Updated about a year ago· 8
Audio Channel Conv and Resampler
  • audio
  • audio_out
channel_conversionkeep
target_sample_rate0
downmix_methodstandard_gain
n_fft2048
hop_length512

Two of the most common "make this audio compatible" operations are changing the channel count and changing the sample rate. You can do them with two nodes, or you can do them with Audio Channel Conv and Resampler (SET_AudioChannelConvResampler), which is just the pack's Audio Channel Converter and Audio Resampler welded into one node. That sounds lazy until you're rebuilding the same "stereo + 48k" setup for the tenth time and realize the combined node is the one you actually want.

Inputs

It's the union of both parents' inputs:

  • channel_conversion - the same five-way dropdown: keep, stereo_to_mono, mono_to_stereo, force_mono, force_stereo.
  • target_sample_rate - the Resampler's input, in Hz. 0 means "leave the sample rate alone."
  • downmix_method - average, standard_gain (default), or spectral - only used when collapsing to mono.
  • n_fft / hop_length - optional, only for spectral downmixing.

One output, audio_out, carrying the audio after both transformations. Batch size is preserved throughout, which is the pack's consistent promise.

The order of operations is channel conversion first, then resampling - a detail that only matters for the spectral downmix path, where the FFT happens on the original rate and the resample happens after. In practice that's the right order: downmix while you still have full frequency resolution.

Why you'd bother

Sample rate and channel count are the two metadata fields that downstream consumers (video muxers, TTS/ASR frontends, model pipelines) check most pedantically. If you know a model wants 16 kHz mono or a video container wants 48 kHz stereo, this node gets you there in one place. It also shrinks your graph: one node instead of two, and one place to look when audio comes out wrong.

It's also the node you'll reach for when the Batch Audios aligner does something you don't want. Recall that batching always snaps everything to audio1's rate and channel policy. When you need deliberate control over what a batch becomes, run it through this node - force_stereo + your target rate - and then batch. That ordering removes the guesswork about which input "wins."

Install & gotchas

From ComfyUI Manager, search "Audio Batch", or:

cd ComfyUI/custom_nodes/
git clone https://github.com/set-soft/ComfyUI-AudioBatch
pip install seconohe

Restart ComfyUI. No model downloads; the resampler is torchaudio's Resample, which ships with ComfyUI.

The gotchas are inherited, so they're both easy to remember. target_sample_rate = 0 means "leave it alone" - a great default, but a silent no-op if you forget to set it. And mono_to_stereo is fake stereo (duplicated channel), which is fine for compatibility and useless for actual stereo width. If you want to resample without touching channels, you don't need this node - the plain Audio Resampler is right there.

Categoryaudio/conversion

Inputs (6)

NameTypeDefaultDescription
audioAUDIO
channel_conversionCOMBOkeepkeep: maintain same channels, stereo_to_mono/force_mono: 1 channel, mono_to_stereo/force_stereo: 2 channels
target_sample_rateINT00–192000Output sample rate, 0 is same as input
downmix_methodCOMBOstandard_gainMethod for stereo/multi-channel to mono conversion: - average: Simple average ((L+R)/2). Can reduce volume. - standard_gain: Sums channels with -3 dB gain (0.707). Better preserves perceived loudness.- spectral: Averages frequency magnitudes to prevent phase cancellation.
n_fftoptINT2048256–8192FFT size for spectral downmixing. Higher values give better frequency resolution but worse time resolution.
hop_lengthoptINT51264–4096Hop length for STFT. Typically n_fft / 4. Controls time resolution.

Outputs (1)

NameTypeDescription
audio_outAUDIO