Nodes/MKRShift_Nodes/Audio Channel Router
ComfyUI Node

Audio Channel Router

Fix, flip, and fold stereo audio without leaving ComfyUI

By criskb·Created 7 months ago·Updated 5 months ago· 0
Audio Channel Router
  • audio
  • audio
  • output_path
  • duration_sec
  • summary
modekeep
output_formatauto
filename_prefixMKR_audio_channel_router
subfolder
overwritefalse
filename_label

Half the audio problems you'll meet in a ComfyUI video pipeline are channel problems, and they're boring to solve by hand: the voice came out mono when you need stereo, the left/right are swapped, or you're trying to widen a stereo field and need it in mid/side form first. MKRAudioChannelRouter is the one-stop node for all of it - eight channel operations in a single dropdown, done in numpy, no ffmpeg required for the routing itself.

This is genuinely the node you reach for when a generated soundtrack lands in the wrong shape, or when you're staging audio for another FX node downstream. It pairs naturally with MKRAudioStereoWidth in the same pack, since width processing really wants mid/side.

How it works

The node decodes your input to a waveform (channels × samples) and applies one of eight modes:

  • keep - pass-through, mostly there so one node can unify format handling.
  • mono_mix - averages channels down to one. Great for dialogue.
  • left_only / right_only - keeps one channel, duplicated to both speakers. The classic way to rescue a single broken channel.
  • swap_lr - flips the stereo image. Instant fix for inverted L/R exports.
  • stereo_from_mono - duplicates mono to both channels (wider-safe).
  • mid_side_encode - converts L/R into M/S. The step before stereo-width work or before side-channel processing.
  • mid_side_decode - converts M/S back to L/R. Run the pair to do mid/side surgery.

The mid/side math is the same one every mixer uses: mid = (L+R)/2, side = (L−R)/2, and decoding is the inverse. Feed a mono file to swap_lr or mid_side_decode and it degrades gracefully with a warning in summary rather than throwing.

Inputs that matter

  • audio - MKR_AUDIO payload, waveform tensor, or file path string; the * input type means ComfyUI won't second-guess you.
  • mode - the eight-option enum above. That's the whole node, really.
  • The standard save block: output_format (auto keeps the source format, else wav/mp3/flac/ogg), filename_prefix, subfolder, overwrite, optional filename_label.

Outputs: audio (MKR_AUDIO), output_path, duration_sec, summary (JSON including which mode ran).

Install

ComfyUI Manager (search "MKRShift Nodes"), or:

cd ComfyUI/custom_nodes
git clone https://github.com/criskb/MKRShift_Nodes

Restart, and you're done - no models, no dependencies beyond numpy/PIL. ffmpeg is only needed if you write compressed formats; WAV works out of the box.

Common issues

The one that trips people: stereo_from_mono does not widen a mono signal, it just mirrors it - if that's what you meant by "make it stereo," fine, but the actual widening tool is MKRAudioStereoWidth. And after a mid_side_encode, don't listen to the result as if it were normal stereo - the side channel sounds like room tone and that's correct. Decode it back (or process it) before judging.

CategoryMKRShift Nodes/Media/Audio/Utility

Inputs (7)

NameTypeDefaultDescription
audio*
modeCOMBOkeep8 options: keep, mono_mix, left_only, right_only, swap_lr, stereo_from_mono, +2
output_formatCOMBOauto5 options: auto, wav, mp3, flac, ogg
filename_prefixSTRINGMKR_audio_channel_router
subfolderSTRING
overwriteBOOLEANfalse
filename_labeloptSTRING

Outputs (4)

NameTypeDescription
audioMKR_AUDIO
output_pathSTRING
duration_secFLOAT
summarySTRING