afloy011-spec e2974ba229 Fix waveform drawing at collapsed widget width after click re-layout
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.
2026-07-06 13:18:41 +04:00
2026-03-25 13:00:27 +04:00

Afloy Audio Tools

Professional audio editing nodes for ComfyUI — trim, measure, and inspect audio without leaving your workflow.

License: MIT Python 3.10+ ComfyUI

Afloy Audio Trim — interactive waveform

Download ZIP  Quick Start  Nodes

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)

  1. Download ZIP (or click the green button above).
  2. Extract the archive — you'll get a folder afloy_audio_tools-main.
  3. Move the whole folder into your ComfyUI custom_nodes directory.
  4. 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, and torch that already ship with ComfyUI. After restart, find all three nodes under Add Node → audio → Afloy Audio Tools.

↑ Back to top

Quick Start

Tip

Use Afloy Audio Trim to trim audio directly inside your workflow.

  1. Add an Afloy Audio Trim node and connect audio.
  2. Drag start_sec / end_sec markers (or press Tab to switch, I / O to set from cursor).
  3. Drag the white scrub cursor to seek; press Space to play / stop (does not re-fetch the file).
  4. After you change the file in Load Audio, click Reload in the node toolbar or press F5.
  5. Use + / - (or mouse wheel) to zoom, Shift + mouse wheel to scroll.

Widget Features


Feature

Details
ToolbarReload (F5), zoom, loop, play — controls stay above the waveform
WaveformFilled-polygon, classic DAW look
MarkersDraggable start / end with zero-crossing snap
Scrub CursorClick to place, drag to seek
PlaybackFrom cursor position, constrained to selection
Region DragGrab inside selection to move both markers
ZoomUp to 50× via + / - buttons or mouse wheel
ScrollHorizontal with Shift + mouse wheel
LoopIn-node playback with loop toggle
TooltipHover to see time under cursor

Keyboard Shortcuts


Key

Action
F5Reload waveform from disk (after changing file in Load Audio)
SpacePlay / Stop
Shift + ← →Nudge active marker by 1 s
TabSwitch active marker (start / end)
ISet start marker to cursor position
OSet end marker to cursor position

↑ Back to top


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
audioAUDIOSource audio signal
start_secFLOATTrim start (seconds)
end_secFLOATTrim end (-1 = end of file)

Outputs


Name

Type

Description
audioAUDIOTrimmed audio segment
waveform_previewIMAGEStatic waveform image
duration_secFLOATSegment length in seconds
timecodeSTRINGMM:SS.ms timecode

Afloy Audio Duration

Returns audio length in multiple formats — useful for syncing with video or animation frames.

Inputs


Name

Type

Description
audioAUDIOSource audio signal
fpsFLOATFrames per second (default 24)

Outputs


Name

Type

Description
duration_secFLOATDuration in seconds
duration_sec_intINTRounded duration
framesINTFrame count at given FPS
timecodeSTRINGMM:SS.ms
sample_rateINTSample rate (Hz)
channelsINTMono / Stereo

Afloy Audio Info

Diagnostic node — outputs audio metadata as individual values and a human-readable summary.

Inputs


Name

Type

Description
audioAUDIOSource audio signal

Outputs


Name

Type

Description
sample_rateINTSample rate in Hz
channelsINTNumber of channels
total_samplesINTTotal sample count
duration_secFLOATDuration in seconds
infoSTRINGHuman-readable summary

↑ Back to top


Requirements

  • ComfyUI — any recent version
  • Python — 3.10+
  • Extra pip packages — none

License

This project is licensed under the MIT License.

S
Description
No description provided
Readme MIT
243 KiB
Languages
JavaScript 84.5%
Python 15.5%