ComfyUI Node

SoxMixNode

Mix Two Audio Clips Into One Inside ComfyUI — No DAW Required

By JohnDoeSmithee·Created 2 years ago·Updated 2 years ago· 1
SoxMixNode
  • audio1
  • audio2
  • AUDIO

You've got two generated audio clips and you want them in one track - dialogue over a music bed, a vocal over a synth line, two foley layers from an LTX or MMAudio pass. Normally that means bouncing to a DAW, or writing a throwaway Python script. SoxMixNode does it in the graph: two AUDIO inputs in, one mixed AUDIO out, no leaving ComfyUI.

It's a one-node pack from JohnDoeSmithee that wraps SoX's mix combine function - the audio equivalent of "I'll just do it in post," except the post is a node. Don't expect balance knobs or fades; it's deliberately tiny. But tiny has its place, and this is the one you'd reach for when you just want two clips laid over each other.

How it works

The mechanism is endearingly direct. The node takes the two audio tensors ComfyUI hands it (the standard {"waveform": ..., "sample_rate": ...} dict), writes each to a temporary WAV file with torchaudio.save, calls SoX via the Python sox binding to combine them with mix, then loads the result back into a tensor and returns it with the batch dimension restored.

Because SoX does the heavy lifting, you get its behavior for free. mix scales each input by 1/n (so two clips means each at half volume - no clipping, but don't expect loudness to add) and the output is as long as the longest input, with the shorter one silence-padded. The README says "two same length audio clips," and that's the safe path, but mismatched lengths won't explode - the longer one just wins. Sample-rate mismatches are handled too: SoX resamples everything up to the highest rate in the mix, so you can feed a 44.1k clip and a 48k clip and get a clean 48k result. It runs entirely on CPU and disk temp space, so it's effectively instant for short clips.

The inputs that matter

The whole API is three sockets, and you only set two:

  • audio1 (AUDIO) - first clip, from any node that outputs AUDIO
  • audio2 (AUDIO) - second clip to lay over it
  • AUDIO (output) - the mix, wired into anything that takes AUDIO: a preview/playback node, SaveAudio, or a video-save node that muxes your frames with the track

There are no optional inputs and no parameters. That's the whole thing.

Installing it - read this before you do

The pack installs two things, and this is where people get burned. requirements.txt only pulls the Python sox package (pysox) - a thin wrapper that shells out to the actual SoX command-line binary, which is a separate system install the wrapper does not bring along. If you only install the pack, you get "sox command not found" on your first run.

Install via ComfyUI Manager (search ComfyUI-SoX-Mixdown), or:

cd ComfyUI/custom_nodes
git clone https://github.com/JohnDoeSmithee/ComfyUI-SoX-Mixdown

Then install the binary and make sure sox is on your PATH:

# Windows
winget install ChrisBagwell.SoX
# macOS
brew install sox
# Linux
apt install sox   # or dnf install sox, or pacman -S sox

On Windows, if you installed the binary while ComfyUI was already running, restart it - the new terminal inherits the updated PATH. The node's __init__.py will also auto-pip-install the Python sox package on first boot and tell you to restart ComfyUI before the node loads; that's expected behavior, not a bug.

Common issues

  • SoxError: sox command not found - the classic. You skipped the binary step. Install SoX per the commands above and check sox --version in a fresh terminal.
  • Node doesn't appear after install - the auto-install of the Python package happened at startup; restart ComfyUI once so the import succeeds.
  • Output is quieter than you expected - that's SoX's 1/n scaling at work. If you want gain staging, run an amplify/volume audio node on the inputs first; this node has no volume control by design.

For layering vocals or music with real fades and EQ, you still want a DAW. For "merge these two generated clips into one track," this is a two-minute setup that stays inside your workflow.

CategoryComfyUI-SoX-Mixdown

Inputs (2)

NameTypeDefaultDescription
audio1AUDIO
audio2AUDIO

Outputs (1)

NameTypeDescription
AUDIOAUDIO