Extensions/comfyui-audio-trimmer
ComfyUI Extension

comfyui-audio-trimmer

Audio trimmer with visual Premiere Pro-style timeline for ComfyUI

By PixalaiΒ·Created 3 months agoΒ·Updated 3 months agoΒ· 0
Pixalai/comfyui-audio-trimmer
Nodes1
On cloudLocal install
Categoryaudio/edit
Stars0
Updated3 months ago
Readme

ComfyUI Audio Trimmer βœ‚οΈπŸŽ΅

A precision audio trimming node for ComfyUI with a visual timeline editor β€” trim any audio directly in your workflow with sample-accurate precision.

ComfyUI Audio Trimmer License

Features

  • Visual Timeline Editor β€” Premiere Pro-style waveform display with interactive trim handles
  • Sample-Accurate Trimming β€” Pure tensor slicing, zero re-encoding or quality loss
  • Precision Zoom β€” Up to 500x zoom with millisecond-level time markers for surgical edits
  • In-Node Playback β€” Preview the selected audio section using Web Audio API (sample-accurate playback)
  • Mouse-Anchored Zoom β€” Ctrl+Scroll zooms centered on your cursor position
  • Lossless Pipeline β€” No compression, resampling, or bit-depth changes at any stage

Installation

ComfyUI Manager

Search for comfyui-audio-trimmer in ComfyUI Manager and click Install.

Manual Installation

cd ComfyUI/custom_nodes
git clone https://github.com/Pixalai/comfyui-audio-trimmer.git

No additional dependencies required β€” uses only built-in ComfyUI/PyTorch modules.

Usage

  1. Connect any AUDIO output to the Audio Trimmer node
  2. Queue the workflow to load the waveform visualization
  3. Drag the green (start) and red (end) handles to set your trim region
  4. Click β–Ά Play to preview the selected section
  5. Queue again to output the trimmed audio

Controls

| Action | What it does | |--------|-------------| | Drag handles | Set trim start/end points | | Drag region | Move the entire selection | | Double-click | Jump nearest handle to click position | | Scroll | Pan the timeline | | Ctrl+Scroll | Zoom in/out (anchored to cursor) | | β–Ά Play / β–  Stop | Preview selected audio section | | +/βˆ’/Reset | Zoom controls |

Audio Quality

This node guarantees zero quality degradation:

| Stage | Operation | Quality Impact | |-------|-----------|---------------| | Input | Raw AUDIO tensor [B, C, T] | Original samples | | Trimming | waveform[:, :, start:end] | Zero loss β€” exact sample slice | | Output | Same tensor, same sample rate | Bit-identical to input section | | Preview | FLAC (lossless) + Web Audio API | Bit-identical decode & playback |

Requirements

  • ComfyUI (latest version recommended)
  • Python 3.10+
  • PyTorch
  • torchaudio

License

MIT License β€” see LICENSE for details.