Nodes/ComfyUI-LoadByUrl/πŸ”Š Load Audio by URL
ComfyUI Node

πŸ”Š Load Audio by URL

Pull a song or voice clip into ComfyUI from a link

By romandev-codexΒ·Created 8 months agoΒ·Updated 7 months agoΒ· 0
πŸ”Š Load Audio by URL
    • AUDIO
    • SAMPLE_RATE
    • SAMPLES
    β—„urlhttps://example.com/audio.mp3β–Ί
    β—„max_seconds0.0β–Ί
    β—„skip_first_seconds0.0β–Ί

    Audio is the part of ComfyUI that never got a first-class onboarding. Images and video have friendly loaders built in; for sound you usually end up hunting through files, converting formats, or relying on a pack to smuggle a file in sideways. LoadAudioByUrl skips the file entirely - paste a URL to an mp3, wav, or whatever, and it lands in your graph as a proper ComfyUI AUDIO object. It's from the small ComfyUI-LoadByUrl pack by romandev-codex, same family as the image and video URL loaders: no API key, no cloud, just an HTTP fetch and local decode.

    When would you actually want this? Whenever the sound matters and isn't already sitting on disk. A voice clip you want to drive a lipsync or audio-avatar node. A song for an audio-reactive workflow. A reference audio for a voice-transfer or style model. The node is the input stage for all of it - get the audio into the graph and the rest of the pipeline takes it from there.

    How it works

    It downloads the file with requests.get, then decodes it with PyAV and normalizes it into the standard ComfyUI AUDIO dict: a waveform tensor (1, channels, samples, floats from -1 to 1) plus a sample_rate int. That's the exact shape audio nodes in ComfyUI expect, so it wires straight into anything that takes an AUDIO socket - lipsync and avatar nodes, audio-driven animation, MMAudio-style stages, or a video-combine node that needs the soundtrack back.

    Two trimming inputs, both defaulted to 0 (meaning "don't trim"):

    • max_seconds - cut the clip to this length. Set it to cap an overlong file, or leave 0 for the whole thing.
    • skip_first_seconds - chop the opening. Handy for stripping silence or an intro.

    Both are straightforward; the one edge case to know is that if skip_first_seconds is bigger than the actual clip, the node raises an error rather than returning silence - trim conservatively.

    Three outputs come back: AUDIO (the object to wire onward), SAMPLE_RATE (the decoded rate as an int), and SAMPLES (the sample count per channel after trimming). The last two are handy if you need the raw numbers for math - like computing clip duration - or for nodes that want an explicit rate instead of trusting the AUDIO dict.

    Installing it - read this one carefully

    ComfyUI Manager β†’ search "LoadByUrl" β†’ install ComfyUI-LoadByUrl, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/romandev-codex/ComfyUI-LoadByUrl
    

    The pack ships with no requirements.txt, and this node needs PyAV (av), which does not come with ComfyUI. If you install the pack and the nodes don't appear under "Remhes/Remote" at all, that's the cause - the import fails on the missing av module. Fix it:

    pip install av
    

    into the same Python environment ComfyUI runs in, then restart.

    Otherwise the standard URL caveats apply: no auth headers or cookies, so a 403-protected or login-gated link will fail; there's no request timeout in the code, so a hanging host can stall your queue; and the file is buffered in memory, which is a non-issue for a 5MB mp3 but worth remembering for a two-hour podcast. It's a small node that does one job - but if your workflow needs audio from a link, it's the missing input you were probably improvising around.

    CategoryRemhes/Remote

    Inputs (3)

    NameTypeDefaultDescription
    urlSTRINGhttps://example.com/audio.mp3β€”
    max_secondsFLOAT0.00–3600β€”
    skip_first_secondsFLOAT0.00–3600β€”

    Outputs (3)

    NameTypeDescription
    AUDIOAUDIOβ€”
    SAMPLE_RATEINTβ€”
    SAMPLESINTβ€”