Nodes/ComfyUI-audio-speed/PT Ensure Stereo
ComfyUI Node

PT Ensure Stereo

Make sure your audio is stereo before something down the chain complains

By ptmaster·Created about a year ago·Updated 2 months ago· 15
PT Ensure Stereo
  • audio
  • audio

PT Ensure Stereo is the smallest node in the ComfyUI-audio-speed pack, and it does exactly one boring, useful thing: makes sure whatever audio you hand it is stereo. ComfyUI's audio handling is loose about channel counts - plenty of sources (mono TTS output, a voice clip you recorded in one channel) produce single-channel waveforms, and plenty of sinks and mixers quietly expect two. This node removes that entire class of failure.

What it does

One input, one output. It checks the channel count on the waveform and acts:

  • Mono (1 channel) - duplicates the channel so L and R are identical. The classic naive stereo-ize, and for dialogue or merged voice tracks it's exactly what you want.
  • Stereo (2 channels) - passes through unchanged, flagged as "kept stereo."
  • More than 2 channels - keeps only the first two and drops the rest. A 5.1 surround clip gets truncated to a plain stereo pair. That's a deliberate choice, not a bug, but know that it discards channels.

The output audio carries a conversion_info field noting which of those three paths ran, so you can tell at a glance whether a given clip was transformed or untouched.

There's nothing to configure - no target-channel picker, no downmix options. It's a guard, not a mastering tool.

Where it belongs

Right before anything that assumes stereo: a mixer/merge node, an audio encode, or a video pipeline that expects a stereo pair. In a typical chain it pairs with its sibling PT 48kHz Resampler - normalize the sample rate on one side, force the channel count on the other, and the downstream merge has nothing left to complain about.

One structural note: it reads channels from waveform.shape[1] and expects the standard ComfyUI audio dict (waveform tensor plus sample_rate). Feed it anything else and you'll get a ValueError about a missing waveform field. So wire it after standard ComfyUI audio-producing nodes, not after something exotic.

Install

Same routine as the rest of the pack. ComfyUI Manager → search ComfyUI-audio-speed → install → restart. Or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/ptmaster/comfyui-audio-speed

Then restart ComfyUI. No requirements.txt, no models to fetch - it needs torchaudio, which the standard PyTorch install already provides. If it won't import, pip install torchaudio in your ComfyUI environment.

Is it worth installing the whole pack for?

Maybe. It's a personal utility from a tiny repo with essentially no community usage, and its behavior is ~30 lines you could reimplement yourself. But if you're already grabbing the pack for PT Audio Speed, or you keep tripping over mono-vs-stereo merge errors, it's a free safety net that costs nothing to drop into the graph.

Categoryaudio/processing

Inputs (1)

NameTypeDefaultDescription
audioAUDIO

Outputs (1)

NameTypeDescription
audioAUDIO