Nodes/MediaForge/🎡 Compose Audio Mix
ComfyUI Node

🎡 Compose Audio Mix

Lay BGM under your video's own audio without a mixer

By leon80148Β·Created 4 months agoΒ·Updated 2 months agoΒ· 0
🎡 Compose Audio Mix
  • audio_ops
  • audio
  • audio_ops
β—„audio_pathinput/bgm.mp3β–Ί
β—„keep_sourcetrueβ–Ί
β—„bgm_volume0.30β–Ί
β—„durationfirstβ–Ί

MF_ComposeAudioMix is the node that puts background music under a video without leaving ComfyUI. It's an audio-chain op in the MediaForge Compose pipeline: point it at a BGM file, tell it how loud the music should sit, and it builds an amix into the filter graph that MF_ComposeVideo renders as part of the single encode. Podcast intro stingers, vlog ambience, a quiet bed under narration - this is the standard move.

The default is worth highlighting: bgm_volume = 0.3. That's the pack's opinion that the voice should stay dominant, and it's right. If your BGM is louder than the talking, you're fighting the mix, not mixing it.

How it works

It appends an amix op to the MF_COMPOSE_AUDIO_OPS chain. keep_source=True mixes your BGM with the source audio; keep_source=False throws the source away and keeps only the music - which is the "replace the original soundtrack entirely" move, e.g. laying a music bed over silent footage. The duration setting (first / longest / shortest) decides how long the mix runs; first means the source's length, which is what you usually want.

There's also a dual-input wrinkle: instead of audio_path, you can wire an audio AUDIO dict pin (from MF_LoadVideoFrames or another audio node). When wired, the dict is materialized to a temp WAV under the plugin's .mf_tmp/ dir, which is swept automatically once it's older than ~24h - don't be alarmed if you see a file linger past the run, that's by design so cache hits can reuse it.

The inputs that matter

  • audio_path - the BGM file. Hidden when the audio pin is wired.
  • keep_source - True = mix both, False = music replaces source.
  • bgm_volume - music gain before the mix. 0.3 keeps voice dominant. Crank toward 1.0 for music-forward pieces, and beware clipping above that.
  • duration - first (source length), longest, or shortest.

Output is audio_ops (MF_COMPOSE_AUDIO_OPS), which chains into the next audio node or straight into MF_ComposeVideo's audio_ops input.

Install

It's part of MediaForge - install the pack once:

cd ComfyUI/custom_nodes
git clone https://github.com/leon80148/comfyui_MediaForge.git
# restart ComfyUI

Or ComfyUI Manager, search "MediaForge".

Common issues

Order matters in this chain. Volume β†’ AudioMix applies the volume to the source before mixing; AudioMix β†’ Volume applies it to the mixed result. If your BGM is loud and your narration is quiet, reach for a MF_ComposeVolume upstream of the mix rather than cranking bgm_volume - separate controls, same encode. And if you hear nothing, check keep_source: with keep_source=False and no BGM file actually at audio_path, you've replaced audio with nothing. The pack prints the compiled filter graph on the filter_complex_script output of ComposeVideo - when a mix surprises you, read that first.

CategoryMediaForge/Compose

Inputs (6)

NameTypeDefaultDescription
audio_pathSTRINGinput/bgm.mp3β€”
keep_sourceBOOLEANtrueβ€”
bgm_volumeFLOAT0.300–2β€”
durationCOMBOfirst3 options: first, longest, shortest
audio_opsoptMF_COMPOSE_AUDIO_OPSβ€”
audiooptAUDIOβ€”

Outputs (1)

NameTypeDescription
audio_opsMF_COMPOSE_AUDIO_OPSβ€”