JR Cut Audio
Trim the track inside ComfyUI instead of round-tripping through Audacity
- audio
- duration_seconds
- status
You have a four-minute song and a five-second clip. Which five seconds? That is normally an Audacity detour: import, eyeball the waveform, export a WAV, drag it back into ComfyUI, discover you wanted the other chorus. JR Cut Audio puts the waveform editor in the node, so you scrub, drag the edges, and lock the slice without leaving the graph.
It's also the one node in this pack that doesn't care whether you have H3 weights at all. No GPU, no diffusion model, no extra audio model - it's a plain sample-exact audio trimmer that happens to live in an H3 pack because that's where the author needed it. If you're building an audio-driven MV, feeding a Director pipeline a reference track, or just want a clean 8-second clip to drive a Sequential Audio run, this is the front door.
What it actually does
The node exposes two widgets, both strings: audio (an input-relative filename, managed by the editor)
and selection (multiline, the locked sample range written by Cut). Everything else is JavaScript.
Choose file to upload drops MP3/WAV/FLAC/OGG/OPUS/M4A/AAC/AIF/WMA into ComfyUI/input/jr_cut_audio
and decodes it on a background CPU thread through PyAV, at the source sample rate and channel layout.
You get a waveform: click to place the playhead, drag the cyan edges, type Start/End seconds
(decimals fine), audition with Play/Pause. Volume only changes what you hear - it never touches the
output.
Then you press Cut & lock output. That writes a selection - source id, sample rate, sample count,
start/end sample - into the selection widget, and the range turns green. If you don't cut, the node
refuses to execute, which is deliberate: it stops you accidentally shoving a whole album into a video
job. Cut also does not queue your workflow, so set your range, then hit the normal Queue button.
At execution the node re-reads the source, verifies the digest, rate and sample count still match what
you locked, and slices waveform[:, first:last]. Boundaries round half-up to the nearest sample. No
fade, no normalisation, no resampling, no downmix to mono - the output is [1, channels, samples] with
the original gain, and the "Download cut WAV" file is that same float32 PCM, not a re-encoded copy.
Inputs and outputs
audio- the locked source filename. You set this with the editor, not by typing.selection- the locked range. Same deal.audio(AUDIO) - the slice. Wire it into Director PIPE Builder's audio input, the Sequential Audio Chunk Driver, or anything else that takes a standard ComfyUIAUDIO.duration_seconds(FLOAT) - the exact cut length. Handy when you're matching clip framing or frame counts, and cheap to read off instead of doing arithmetic by hand.status(STRING) - the locked range, duration, sample rate and channel count, for the log.
Install
ComfyUI Manager, search JR MiniMax H3 (registry publisher goldlionren), or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/Goldlionren/ComfyUI_JR_MiniMaxH3Node.git
# with the SAME Python that runs ComfyUI - not your system Python:
python -m pip install -r ComfyUI_JR_MiniMaxH3Node/requirements.txt
Restart ComfyUI, then hard-refresh the browser - the editor is a JS extension and a stale bundle is
the usual reason the waveform panel looks wrong. The pack's requirements are literally just
imageio-ffmpeg>=0.5; this node's decoding uses PyAV, which ComfyUI already ships. The RTX extras in
requirements-rtx.txt are for a different node entirely.
Where people get burned
- Clicks at the cut boundary. There's no auto-fade, so slicing at a non-zero crossing pops. Nudge the edges a few samples until it's clean, or fade it downstream yourself.
- Swapping the file behind the node. The workflow stores the relative path and a SHA-256, not the
music. Replace
song.mp3with a differentsong.mp3and execution fails with "decoded source no longer matches the locked selection" - unlock, re-range, Cut again. Move the audio file with the workflow when you move the workflow. - One editor at a time. The server keeps a single decoder slot, so a second simultaneous request gets "Audio editor is busy; retry shortly" rather than queueing. Sensible, occasionally surprising.
- Limits. 512 MiB file, 256 MiB decoded PCM, 2 hours, 1–8 channels, 90-second decode timeout - whichever bites first stops it. Long PCM-heavy WAVs hit the decoded ceiling well before the file ceiling.
- Codec roulette. Support comes from the PyAV/FFmpeg build inside your ComfyUI. MP3/WAV/FLAC/OGG are safe; WMA and some M4A files may simply not decode.
Previews and cut WAVs cache under temp/jr_cut_audio. Deleting them is safe (they regenerate), but
they accumulate one file per selection, so don't be shocked by the folder size. Nothing is uploaded
anywhere - files stay on your ComfyUI server, and only local input-directory paths with the supported
extensions are readable.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| audio | STRING | Input-relative source audio filename (managed by the editor). | |
| selection | STRING | Locked sample selection created by Cut. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| audio | AUDIO | — |
| duration_seconds | FLOAT | — |
| status | STRING | — |