ComfyUI Node

Media Range (Input)

Trim upstream AUDIO or VIDEO by waveform — no re-upload

By alice-lab-dev·Created about a month ago·Updated 10 days ago· 2
Media Range (Input)
  • audio
  • video
  • audio
  • start_seconds
  • end_seconds
  • duration_seconds
  • video
start_seconds0.000
end_seconds0.000
a_seconds0.000
b_seconds0.000

The other Media Range nodes load files. This one loads whatever is already in your graph. Media Range (Input) takes exactly one upstream AUDIO or VIDEO, shows you its waveform, lets you pick an A-B range, and passes the selection downstream - no re-uploading, no temp files on your side. If you've generated a minute of TTS and only want the one good sentence, this is the node that cuts it out while you watch the waveform.

It's part of ComfyUI ALICE Lab Audio Tools, the fresh alpha pack (Apache 2.0, no pip deps, bilingual EN/JA) from ALICE Lab. It also doubles as a free preview node: run anything audio or video through it and you get a waveform view plus the actual selection, which makes it a handy debugging stop in any pipeline.

How it works

The rule is strict: connect exactly one input, audio or video, not both and not neither - the source code throws an error otherwise. For an AUDIO input it trims samples directly off the tensor, which means the sample rate and channel count are preserved (unlike the file-based loaders, which normalize to 44.1 kHz stereo). For a VIDEO input it trims the video and, when the video has an audio stream, extracts it as 44.1 kHz stereo.

The end_seconds = 0 quirk is worth knowing before it confuses you: on the first run, an end of 0 means "the full input," which is how the node loads the preview and learns the duration. Edit the A-B range and run again to get your actual selection. If upstream audio changes and your old range is entirely beyond the new, shorter input, the node politely resets to the full selection rather than erroring out.

Inputs and outputs

Inputs: start_seconds, end_seconds (both floats with millisecond steps; end_seconds carries the author's own tooltip - "0 selects the full input on the first run"), plus the one audio or video connection. Outputs are the same shape as the loader variants:

  • audio - the trimmed AUDIO.
  • start_seconds / end_seconds / duration_seconds - the actual selected range.
  • video - the trimmed VIDEO, when the input was video.

Two availability rules from the README: an audio-only input has no video output, and a video without an audio stream has no audio output. Wire accordingly.

Where you'll actually use it

The natural chain: a TTS node or sampler outputs AUDIO → Media Range (Input) trims the good take → Output Waveform to hear it, or Audio to Irodori Ref Config if you're doing Irodori voice cloning, or Audio Mixer if it's going into a larger mix. For video, hang it off a loader or generation node to preview and slice before downstream processing. It's also the only range node that works mid-graph without touching your input folder, which makes it the one I reach for most.

Install

# ComfyUI Manager → search "ComfyUI ALICE Lab Audio Tools" → Install → restart
# or:
cd ComfyUI/custom_nodes
git clone https://github.com/alice-lab-dev/ComfyUI-ALICE-Lab-Audio-Tools
# restart, then Add Node → ALICE_Lab → Media

Standard pack requirements: ffmpeg + ffprobe on the ComfyUI process PATH (macOS Homebrew paths auto-checked) and a current ComfyUI with the AUDIO/VIDEO types. No models, no pip deps.

CategoryALICE_Lab/Media

Inputs (6)

NameTypeDefaultDescription
start_secondsFLOAT0.0000–86400
end_secondsFLOAT0.0000–864000 selects the full input on the first run.
a_secondsFLOAT0.0000–86400Local A marker inside the input start/end window.
b_secondsFLOAT0.0000–86400Local B marker; 0 selects the complete input window.
audiooptAUDIO
videooptVIDEO

Outputs (5)

NameTypeDescription
audioAUDIO
start_secondsFLOAT
end_secondsFLOAT
duration_secondsFLOAT
videoVIDEO