π Compose Audio Fade
Fade audio in and out without a separate audio editor
- audio_ops
- audio_ops
MF_ComposeAudioFade is one op in MediaForge's Compose audio chain: it appends an afade to the audio filter graph and hands the chain on. If you've ever shipped a clip that starts and ends with an abrupt thunk of audio, this is the two-widget fix. Intro fade-in, outro fade-out, done - without opening a DAW.
It's part of the "one op = one node" design that keeps the Compose audio chain composable. The whole point is that audio ops stack in wiring order - Volume β Fade and Fade β Volume are genuinely different output - and a chain of small nodes expresses that cleanly. Want both a fade-in and a fade-out? Drop two of these in series. Each one appends its filter to whatever came before.
How it works
Under the hood it writes an afade filter op into the MF_COMPOSE_AUDIO_OPS chain. ComposeVideo later compiles that chain (alongside any video overlays) into a single filter_complex graph and encodes once. Nothing here touches pixels - the whole audio chain is a list of dicts that gets resolved at encode time.
The inputs that matter
direction-in(silent β full, use at the start) orout(full β silent, use at the end).start_sec- when the fade begins. Forout, that meansvideo_duration - duration_sec; the readme's framing is the reliable mental model.duration_sec- fade length. Two seconds is a good default; anything longer starts to feel sleepy.curve- the shape.tri(linear) is default, butqsin(quarter-sine) is the perceptually smoothest and is what I'd pick for anything that's going on a podcast or a finished video. The rest (esin,hsin,log,par,qua,cub,squ,cbr) are there if you need a specific character.
The optional audio_ops input is the upstream chain - wire the previous audio node's output here, or leave it unwired to start a fresh chain. Output is audio_ops, which feeds the next audio node or MF_ComposeVideo directly.
Install
Part of the MediaForge pack, nothing extra to install:
cd ComfyUI/custom_nodes
git clone https://github.com/leon80148/comfyui_MediaForge.git
# restart ComfyUI
Or ComfyUI Manager β search "MediaForge". The pack's requirements.txt handles its small Python deps (including ffmpeg fallback binaries) automatically.
Common issues
The classic mistake is treating start_sec as "fade out starting from here" for direction=out - it is the start, so you have to compute it against your video's duration. And if the fade seems to do nothing, check your chain order: if a MF_ComposeVolume with scale=0 is upstream, there's no signal left to fade. Since these are filter ops, one typo in an earlier node's parameters surfaces as a RuntimeError: ffmpeg ... failed at encode time - scroll up, the last 30 lines of stderr are printed.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| direction | COMBO | in | 2 options: in, out |
| start_sec | FLOAT | 0.00β36000 | β |
| duration_sec | FLOAT | 2.00.1β60 | β |
| curve | COMBO | tri | 10 options: tri, qsin, esin, hsin, log, par, +4 |
| audio_opsopt | MF_COMPOSE_AUDIO_OPS | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| audio_ops | MF_COMPOSE_AUDIO_OPS | β |