π΅ Compose Audio Mix
Lay BGM under your video's own audio without a mixer
- audio_ops
- audio
- audio_ops
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 theaudiopin is wired.keep_source-True= mix both,False= music replaces source.bgm_volume- music gain before the mix.0.3keeps voice dominant. Crank toward1.0for music-forward pieces, and beware clipping above that.duration-first(source length),longest, orshortest.
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.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| audio_path | STRING | input/bgm.mp3 | β |
| keep_source | BOOLEAN | true | β |
| bgm_volume | FLOAT | 0.300β2 | β |
| duration | COMBO | first | 3 options: first, longest, shortest |
| audio_opsopt | MF_COMPOSE_AUDIO_OPS | β | |
| audioopt | AUDIO | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| audio_ops | MF_COMPOSE_AUDIO_OPS | β |