comfyui-audio-trimmer
Audio trimmer with visual Premiere Pro-style timeline for ComfyUI
Nodes (1)
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.
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
- Connect any
AUDIOoutput to the Audio Trimmer node - Queue the workflow to load the waveform visualization
- Drag the green (start) and red (end) handles to set your trim region
- Click βΆ Play to preview the selected section
- 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.