Add SxCP Audio Wave + Segments: interactive waveform node (upload/play/click-segments)

New node with a JS widget (web/audio_wave.js): upload an audio clip, play it, and click
the waveform to place segment boundaries (click add / drag move / dblclick note /
shift|right-click delete). Boundaries+notes serialize to a hidden segments_json that
drives Python segmentation (falls back to auto-split / notes syntax). Python node
(nodes/audio_wave_segments.py) loads the file (torchaudio/soundfile/librosa), builds
segments from the boundaries, and outputs waveform_image + audio_summary + AUDIO — same
contract as Audio Prompt Guide, so it feeds chat mode the same way. _attach_notes now
merges (keeps clicked notes). WEB_DIRECTORY re-enabled. JS is a first cut — needs testing
in ComfyUI (console logs on error); the Python node works standalone via segments_json/notes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-04 22:31:45 +02:00
co-authored by Claude Opus 4.8
parent d7b9907f56
commit 57b459b956
6 changed files with 338 additions and 4 deletions
+2 -1
View File
@@ -56,7 +56,8 @@ def _attach_notes(segs, notes):
seg_map, time_notes, glob = _split_notes(notes)
for s in segs:
s0, s1 = s["start_s"], s["start_s"] + s["duration_s"]
found = list(seg_map.get(s["segment"], []))
existing = (s.get("note") or "").strip()
found = ([existing] if existing else []) + list(seg_map.get(s["segment"], []))
found += [txt for (t0, t1, txt) in time_notes if t0 < s1 and t1 > s0]
s["note"] = "; ".join(found)
return glob