ComfyUI Node

Media Range (URL)

Slice a clip out of a remote video URL without downloading the whole file

By alice-lab-dev·Created 19 days ago·Updated a day ago· 2
Media Range (URL)
    • audio
    • start_seconds
    • end_seconds
    • duration_seconds
    • video
    url
    start_seconds0.000
    end_seconds10.000
    video_encoderauto

    The name is doing honest work for once: this node reads only the start_secondsend_seconds interval out of a direct HTTP(S) media URL and hands you the clip as AUDIO and VIDEO. It never downloads the whole remote file or expands it into Python frame tensors. If your source media lives on a CDN, an object store, or some temporary signed link, this is the ALICE Lab node you actually want - the alternative is downloading a multi-gigabyte file to your ComfyUI box just to use ten seconds of it.

    Audio is the newest, thinnest layer in ComfyUI, and this pack lives there: waveform-first A-B range selection rather than pure generation. Media Range (URL) is one of four siblings - Upload, Path, URL, and Input - that all select a range the same way and differ only in where the source comes from. URL is the one for media you never had locally.

    How it works

    Every execution, the node runs ffprobe against the URL to read metadata, then lets FFmpeg pull just the requested interval into a persistent local cache file. The cache key is a hash of the URL plus the exact start/end/encoder settings, so rerunning with an identical URL and range skips the network entirely and reuses what's on disk. Your preview and waveform are served from that local file too, which means dragging around in the UI doesn't hammer the remote server - but it also means the preview only reflects the currently loaded interval.

    The inputs and outputs that matter

    The schema is compact:

    • url - a direct http:// or https:// media URL that FFmpeg can open. Not a YouTube page, not a site that needs auth, not DRM content. If you're feeding it a page URL, resolve it to a direct stream URL with another node first - the README is explicit that page resolution and yt-dlp are intentionally not included.
    • start_seconds / end_seconds - the range, in seconds, up to 86400 with millisecond stepping. end defaults to 10.
    • video_encoder - auto, nvenc, videotoolbox, or cpu. auto runs a real one-frame test encode, prefers VideoToolbox on macOS and NVENC elsewhere, and falls back to CPU libx264. Pick an encoder explicitly and have it be unavailable, and you get an error instead of a silent drop to CPU - which is the right failure mode.

    Outputs, in order: audio (44.1 kHz stereo), start_seconds, end_seconds, duration_seconds, and video - a standard ComfyUI VIDEO when the source has a video stream. Audio-only URLs give you the audio and the floats with no video output, and the node expects a single URL containing both streams (or audio alone); it won't combine separate video and audio URLs.

    One nice touch: signed query strings get passed to FFmpeg as a single subprocess argument and are stripped from the displayed URL and any error details - so signed CDN links keep working without leaking their tokens into your logs.

    Installing it

    Grab the whole pack via ComfyUI Manager (search "ComfyUI ALICE Lab Audio Tools"), or clone it by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/alice-lab-dev/ComfyUI-ALICE-Lab-Audio-Tools
    # restart ComfyUI
    

    The catch: this pack has no bundled ffmpeg. It shells out to system ffmpeg and ffprobe, which must be visible to the ComfyUI process itself - not just your interactive shell. On macOS, GUI-launched ComfyUI won't inherit your shell PATH, so make sure /opt/homebrew/bin or /usr/local/bin is covered. There are no pip dependencies beyond what ComfyUI ships and no model downloads. It needs a ComfyUI build with the current AUDIO type and comfy_api.latest video APIs - keep the frontend reasonably fresh, and hard-refresh (Ctrl+Shift+R) after any ComfyUI update or the node UI can render wrong.

    Common gotchas

    • Expired or dead URLs. Direct stream links expire. HTTP 403/404, DNS failures, timeouts, disconnects, "unsupported media" - just re-resolve the URL and try again. The pack is alpha; expect the error text to be informative rather than polished.
    • Range won't preview. You moved A or B past what's cached for the current interval. Run the workflow, then preview.
    • Server-side trust. The ComfyUI server does the fetching, with no site allowlist. Use it on a server you trust, with URLs you trust.

    Also worth knowing: this is a recent alpha from ALICE Lab (a solo-ish Japanese dev lab publishing under alice-lab-dev), Apache-2.0 licensed, with essentially no community footprint yet - when something misbehaves, GitHub issues is your real support channel, not a search for your exact error.

    CategoryALICE_Lab/Media

    Inputs (4)

    NameTypeDefaultDescription
    urlSTRING
    start_secondsFLOAT0.0000–86400
    end_secondsFLOAT10.0000.001–86400
    video_encoderCOMBOauto4 options: auto, nvenc, videotoolbox, cpu

    Outputs (5)

    NameTypeDescription
    audioAUDIO
    start_secondsFLOAT
    end_secondsFLOAT
    duration_secondsFLOAT
    videoVIDEO