ComfyUI Node

Audio Blend

Mix two audio tracks together in ComfyUI

By jamesWalker55·Created 3 years ago·Updated about a year ago· 217
Audio Blend
  • a
  • b
  • AUDIO
ratio0.50
if_durations_differuse_longest
if_samplerates_differuse_highest

JWAudioBlend mixes two audio clips into one, with a ratio slider to control the balance between them. As ComfyUI has grown an AUDIO type - driven by the wave of audio and music models people now run in the graph - you occasionally need to combine two audio streams, and this is a clean little node for exactly that.

The obvious use is layering: a generated music bed under a generated voice, an ambience track blended with a sound effect, or two variations mixed to taste. The ratio control is a straight crossfade knob - push it toward a, push it toward b, or sit at 0.5 for an even mix. Where it earns its keep over "just overlay them" is that it handles the two things that normally make audio mixing annoying: clips of different lengths, and clips at different sample rates. You tell it how to resolve each, and it does the bookkeeping.

What it actually does

It combines audio a and audio b weighted by ratio, then hands back a single AUDIO. Because real clips rarely match perfectly, it exposes two policy switches. if_durations_differ decides whether the output runs to the length of the longer clip (padding the shorter) or the shorter one (trimming the longer). if_samplerates_differ decides whether to resample everything up to the higher sample rate or down to the lower one. Set those once and you don't have to pre-align your clips by hand.

The inputs and outputs that matter

  • a and b (AUDIO) - the two clips to mix.
  • ratio (FLOAT, 0–1, default 0.5) - the balance. 0.5 is even; toward 0 favors a, toward 1 favors b.
  • if_durations_differ - enum, use_longest (default) or use_shortest. Whether the output matches the longer or shorter clip.
  • if_samplerates_differ - enum, use_highest (default) or use_lowest. Which sample rate wins when they don't match.

Output is a single AUDIO. Feed it into a save-audio node, or into a video pipeline that muxes audio onto frames.

How to install it

Pack: jamesWalker55/comfyui-various. ComfyUI Manager - search Various ComfyUI Nodes by Type, install, restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/jamesWalker55/comfyui-various

then restart. Heads up: JWAudioBlend is one of the newer additions and isn't listed in the pack's README node index yet - the author says up front the repo is "still in early stages" and the docs lag the code. Because it's not called out in the per-file list, cloning the whole repo (or installing via Manager) is the reliable way to get it, rather than trying to guess which single file it's in.

Common issues & troubleshooting

No AUDIO source to feed it. This node mixes audio you already have in the graph - it doesn't generate or load anything. You need an audio model's output, or a load-audio node, on both a and b before this does anything.

Duration and sample-rate surprises. If your mix comes out shorter than expected, if_durations_differ is probably on use_shortest and it clipped to the shorter track. If the quality sounds off, check if_samplerates_differ - forcing everything down to a low sample rate (use_lowest) will audibly degrade a high-rate clip. The defaults (use_longest, use_highest) are the safe, non-destructive choices for most cases.

It's a blend, not a concatenation. This overlaps the two clips and mixes them together; it does not play one after the other. For sequencing audio end-to-end you'd want a join/concatenate node instead.

CategoryjamesWalker55

Inputs (5)

NameTypeDefaultDescription
aAUDIO
bAUDIO
ratioFLOAT0.500–1
if_durations_differCOMBOuse_longest2 options: use_longest, use_shortest
if_samplerates_differCOMBOuse_highest2 options: use_highest, use_lowest

Outputs (1)

NameTypeDescription
AUDIOAUDIO