Frontend 1.43+ passes the layout-assigned widget width to draw(), which can collapse to minWidth after a click. Draw from the actual node width instead, matching the mouse handler's coordinates.
Afloy Audio Tools
Professional audio editing nodes for ComfyUI — trim, measure, and inspect audio without leaving your workflow.
Contents
Installation
Important
This is a single package containing all 3 nodes. You install it once — all nodes appear automatically.
Option A — Download ZIP (easiest)
- Download ZIP (or click the green button above).
- Extract the archive — you'll get a folder
afloy_audio_tools-main. - Move the whole folder into your ComfyUI
custom_nodesdirectory. - Restart ComfyUI.
After installation your folder structure should look like this:
ComfyUI/
└── custom_nodes/
└── afloy_audio_tools-main/ ← the folder you moved
├── __init__.py ← all 3 nodes live here
├── web/
│ └── trim_audio.js
├── docs/
├── LICENSE
└── README.md
Option B — Git clone
cd ComfyUI/custom_nodes
git clone https://github.com/afloy011-spec/afloy_audio_tools.git "Afloy Audio Tools"
Restart ComfyUI.
Note
No extra pip packages needed — the nodes use
numpy,Pillow, andtorchthat already ship with ComfyUI. After restart, find all three nodes under Add Node → audio → Afloy Audio Tools.
Quick Start
Tip
Use Afloy Audio Trim to trim audio directly inside your workflow.
- Add an Afloy Audio Trim node and connect
audio. - Drag
start_sec/end_secmarkers (or pressTabto switch,I/Oto set from cursor). - Drag the white scrub cursor to seek; press
Spaceto play / stop (does not re-fetch the file). - After you change the file in Load Audio, click Reload in the node toolbar or press
F5. - Use
+/-(or mouse wheel) to zoom,Shift + mouse wheelto scroll.
Widget Features
Feature | Details |
|---|---|
| Toolbar | Reload (F5), zoom, loop, play — controls stay above the waveform |
| Waveform | Filled-polygon, classic DAW look |
| Markers | Draggable start / end with zero-crossing snap |
| Scrub Cursor | Click to place, drag to seek |
| Playback | From cursor position, constrained to selection |
| Region Drag | Grab inside selection to move both markers |
| Zoom | Up to 50× via + / - buttons or mouse wheel |
| Scroll | Horizontal with Shift + mouse wheel |
| Loop | In-node playback with loop toggle |
| Tooltip | Hover to see time under cursor |
Keyboard Shortcuts
Key | Action |
|---|---|
F5 | Reload waveform from disk (after changing file in Load Audio) |
Space | Play / Stop |
Shift + ← → | Nudge active marker by 1 s |
Tab | Switch active marker (start / end) |
I | Set start marker to cursor position |
O | Set end marker to cursor position |
Nodes
Note
All three nodes appear under audio → Afloy Audio Tools in the Add Node menu.
Afloy Audio Trim
Interactive audio trimmer with a DAW-style waveform widget.
Inputs
Name | Type | Description |
|---|---|---|
audio | AUDIO | Source audio signal |
start_sec | FLOAT | Trim start (seconds) |
end_sec | FLOAT | Trim end (-1 = end of file) |
Outputs
Name | Type | Description |
|---|---|---|
audio | AUDIO | Trimmed audio segment |
waveform_preview | IMAGE | Static waveform image |
duration_sec | FLOAT | Segment length in seconds |
timecode | STRING | MM:SS.ms timecode |
Afloy Audio Duration
Returns audio length in multiple formats — useful for syncing with video or animation frames.
Inputs
Name | Type | Description |
|---|---|---|
audio | AUDIO | Source audio signal |
fps | FLOAT | Frames per second (default 24) |
Outputs
Name | Type | Description |
|---|---|---|
duration_sec | FLOAT | Duration in seconds |
duration_sec_int | INT | Rounded duration |
frames | INT | Frame count at given FPS |
timecode | STRING | MM:SS.ms |
sample_rate | INT | Sample rate (Hz) |
channels | INT | Mono / Stereo |
Afloy Audio Info
Diagnostic node — outputs audio metadata as individual values and a human-readable summary.
Inputs
Name | Type | Description |
|---|---|---|
audio | AUDIO | Source audio signal |
Outputs
Name | Type | Description |
|---|---|---|
sample_rate | INT | Sample rate in Hz |
channels | INT | Number of channels |
total_samples | INT | Total sample count |
duration_sec | FLOAT | Duration in seconds |
info | STRING | Human-readable summary |
Requirements
- ComfyUI — any recent version
- Python — 3.10+
- Extra pip packages — none
License
This project is licensed under the MIT License.
