Nodes/MD Nodes/MD: Audio Simple Editor ✂️
ComfyUI Node

MD: Audio Simple Editor ✂️

Trim and fade your audio without leaving ComfyUI

By MDMAchine·Created about a year ago·Updated 3 months ago· 15
MD: Audio Simple Editor ✂️
  • audio
  • edited_audio
  • waveform_plot
trim_start_sec0.00
trim_end_sec0.00
fade_in_sec0.00
fade_out_sec0.00
fade_curveLinear
debug_mode0 - Silent
enable_profilingfalse

Generative audio almost never ends exactly where you want it. There's a stray artifact in the first second, a generation tail that cuts off abruptly at the end, or a loop that clicks because the ends don't meet. MD_AudioSimpleEditor does the three things you need for all of those - trim the start, trim the end, and fade the boundaries - right in the graph, no DAW export round-trip.

It takes a standard ComfyUI AUDIO dictionary and edits the waveform samples directly: cut out the first N seconds, cut everything past an absolute end time, then apply fade-in/fade-out ramps. That's the whole feature set, and "simple" is doing honest work in the name.

The inputs

  • audio - the AUDIO to edit, from LoadAudio, an ACE-Step decoder, wherever.
  • trim_start_sec - seconds to remove from the beginning. The tooltip's suggestion is the practical one: use it to strip generation artifacts at the start of a track.
  • trim_end_sec - the absolute end time of the track, measured from the original start, not from the trimmed start. 0.0 keeps the original length; anything above 0 cuts everything past that point. It's an easy detail to get backwards the first time.
  • fade_in_sec / fade_out_sec - durations of the ramps, applied after trimming. The tooltip's recommendations are worth taking: even a tiny 0.05s fade-in prevents click/pop artifacts, and 1–3s fade-out smooths an abrupt cut into a natural ending. Essential for seamless loops.
  • fade_curve - Linear or Exponential. Linear for short crossfades, Exponential for musical fade-outs - exponential tracks human hearing better and sounds more natural on anything longer than about a second.

Outputs: edited_audio (the trimmed, faded AUDIO, chain it into your save node) and waveform_plot (an IMAGE of the result, handy for confirming the trim visually before you export).

How it fits a workflow

The natural pipeline is generate → Simple Editor (strip the dead start, fade the tail) → Guardian (make sure nothing's blown out) → save. For looped audio, the discipline is: find the loop point, set trim_end_sec to it, and put a small fade-in and fade-out so the seam is inaudible - the tooltip calls fades "essential for seamless loops," and it's right.

Installing it

Part of MD Nodes (MDMAchine/ComfyUI_MD_Nodes). ComfyUI Manager → search MD_Nodes → Install, restart, or:

cd path/to/ComfyUI/custom_nodes
git clone https://github.com/MDMAchine/ComfyUI_MD_Nodes.git
cd ComfyUI_MD_Nodes
pip install -r requirements.txt

The waveform plot needs matplotlib (in the pack's requirements); editing itself is plain tensor math. Python 3.10+, current ComfyUI.

Common issues

Memory is the quiet gotcha the tooltip flags: editing keeps the whole waveform in memory, so very long tracks (an hour+) can get heavy - trim early in your chain rather than after piling up generations. And the trim_end_sec measurement base trips people once: it's absolute from the original start, so if you trim 10s off the start and set end to 30s, you get 20s of audio (10→30), not 30s. That's by design; read the tooltip before you call it a bug.

CategoryMD_Nodes/Audio

Inputs (8)

NameTypeDefaultDescription
audioAUDIOAUDIO INPUT • Purpose: The ComfyUI audio dictionary to be edited. • Range: Standard [batch, channels, samples] tensor. • Trade-offs: Memory usage scales with audio length. • Recommended: Provide raw, uncompressed audio. ⭐ Standard format from LoadAudio or AceT5 nodes.
trim_start_secFLOAT0.000–3600TRIM START (SECONDS) • Purpose: Removes audio from the beginning of the track. • Range: 0.0 to length of audio. • Trade-offs: High precision available (0.01s steps). • Recommended: 0.0 to keep original start. ⭐ Useful for removing generation artifacts at start.
trim_end_secFLOAT0.000–3600TRIM END (SECONDS) • Purpose: Defines the absolute end time of the track. • Range: 0.0 = Keep original length. > 0.0 = Cut point. • Trade-offs: Anything past this timestamp is discarded. • Recommended: 0.0 to keep original end. ⭐ Note: Calculated from ORIGINAL start, not trimmed start.
fade_in_secFLOAT0.000–60FADE IN DURATION • Purpose: Ramps volume up from complete silence. • Range: 0.0 (Off) to 60 seconds. • Trade-offs: Applied AFTER the audio is trimmed. • Recommended: 0.05s to prevent click/pop artifacts. ⭐ Essential for seamless loops.
fade_out_secFLOAT0.000–60FADE OUT DURATION • Purpose: Ramps volume down to complete silence. • Range: 0.0 (Off) to 60 seconds. • Trade-offs: Applied at the very end of the trimmed track. • Recommended: 1.0s to 3.0s for natural song endings. ⭐ Smooths out abrupt generation cuts.
fade_curveCOMBOLinearFADE CURVE SHAPE • Purpose: Determines the mathematical slope of the fade. • Options: - Linear: Straight mathematical ramp (good for short crossfades). - Exponential: Follows human hearing curve (sounds more natural). • Recommended: Exponential for musical fade-outs. ⭐ Most users: Linear for < 0.1s, Exponential for > 1.0s.
debug_modeCOMBO0 - SilentLOGGING VERBOSITY • Purpose: Controls console output detail level. • Options: - 0 - Silent: No output (production) - 1 - Info: Stats and reports - 2 - Verbose: Step-by-step logging • Recommended: Silent for general use. ⭐ Use Info mode when optimizing workflow timings.
enable_profilingBOOLEANfalsePERFORMANCE PROFILING • Purpose: Enable detailed operation timing. • Options: True/False. • Recommended: False unless debugging. ⭐ Automatically enabled when debug_mode >= 1.

Outputs (2)

NameTypeDescription
edited_audioAUDIO
waveform_plotIMAGE