Audio Trim/Fade/Normalize
Cut, fade, and loudness-match in one node
- audio
- audio
- output_path
- duration_sec
- summary
This is the node that does the three edits every piece of finished audio needs - cut the dead parts, fade the edges so nothing clicks, and set the loudness so it matches the rest of your project. MKRAudioTrimFadeNormalize is the closest thing in the MKRShift_Nodes audio set to "one button audio polish," and for generated voice clips it's often the entire finishing stage by itself. The peak_-1db default even gives you a sensible loudness target out of the box, which is more than most people set up on their own.
It's a Utility, but it's the last one in the chain before export: trim → fade → normalize → MKRPresaveAudio → done.
How it works
With a file input and ffmpeg, it builds a single ffmpeg filter chain:
- Trim via
atrim-start_sec/end_seccut the region you want.end_sec = -1(the default) means "to the end." Set both and it cuts a precise window; set onlystart_secand it trims from there. - Fades via
afade-fade_in_secandfade_out_secramp volume up at the head and down at the tail, eliminating clicks at the cut points. The fade-out length is subtracted from the trimmed duration automatically. - Normalize via one of four
normalize_modes:offdoes nothing;peak_-1db(default) usesdynaudnormto bring the loudest peak to just under full scale;lufs_-14andlufs_-16use ffmpeg'sloudnormfor a true loudness (LUFS) match - −14 LUFS is the streaming standard, −16 is the broadcast/podcast target.
If the input is a waveform payload rather than a file, it falls back to numpy trimming/fading (with peak normalization only - the LUFS modes need ffmpeg's loudnorm).
Inputs that matter
audio-MKR_AUDIOpayload, waveform tensor, or file path.start_sec/end_sec- the trim window.end_secdefaults to −1 (through to the end).fade_in_sec/fade_out_sec- 0 to 60 s each. 50–150 ms is the sweet spot for dialogue.normalize_mode-off,peak_-1db,lufs_-14,lufs_-16.- Standard save block:
output_format,filename_prefix,subfolder,overwrite, optionalfilename_label.
Outputs: audio (MKR_AUDIO), output_path, duration_sec (post-trim), summary.
Install
ComfyUI Manager (search "MKRShift Nodes"), or:
cd ComfyUI/custom_nodes
git clone https://github.com/criskb/MKRShift_Nodes
Restart. The full normalize modes and fades need ffmpeg on PATH - without it you're limited to the numpy fallback (trim + peak normalize only). No models.
Common issues
Biggest one: LUFS vs peak is not a preference, it's a target. peak_-1db makes the clip as loud as possible without clipping, which is fine for a single voiceover but wrong if you're matching a project where other tracks were loudness-matched. If clips in your timeline sound inconsistent, use the same LUFS mode on all of them - that's the point of loudness normalization. Second, end_sec uses a sentinel value of −1 for "rest of clip," so you can't actually trim to a negative end time - set it to 0 or a positive number or you'll get the whole tail back. And dynaudnorm on peak_-1db can pump on very dynamic material; if the voice swells oddly, switch to lufs_-16 which behaves more gently.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| audio | * | — | |
| start_sec | FLOAT | 0.000–86400 | — |
| end_sec | FLOAT | -1.00-1–86400 | — |
| fade_in_sec | FLOAT | 0.000–60 | — |
| fade_out_sec | FLOAT | 0.000–60 | — |
| normalize_mode | COMBO | peak_-1db | 4 options: off, peak_-1db, lufs_-14, lufs_-16 |
| output_format | COMBO | auto | 5 options: auto, wav, mp3, flac, ogg |
| filename_prefix | STRING | MKR_audio_edit | — |
| subfolder | STRING | — | |
| overwrite | BOOLEAN | false | — |
| filename_labelopt | STRING | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| audio | MKR_AUDIO | — |
| output_path | STRING | — |
| duration_sec | FLOAT | — |
| summary | STRING | — |