Nodes/comfyui-audio-processing/Load Audio From Path
ComfyUI Node

Load Audio From Path

Skip the upload folder and point at any file on disk

By rhdunn·Created 2 years ago·Updated 2 years ago· 13
Load Audio From Path
    • AUDIO
    audio

    ComfyUI's built-in Load Audio node only reads files you've dragged into the browser and dumped in the input/ folder. That's fine for interactive work, but it's a pain when your audio lives elsewhere - a dataset directory, a scratch folder, a network share. Load Audio From Path is the same idea with one difference: you give it a filesystem path and it reads from there. That's the whole pitch, and honestly it's a good one.

    How it works

    It's a thin wrapper around torchaudio.load(). Give it a path string, it decodes the file and returns a standard AUDIO object - a waveform tensor plus a sample rate - in exactly the format ComfyUI's own audio nodes use. The README explicitly says the pack is "compatible with the ComfyUI audio nodes," which means the output wires straight into ComfyUI core's PreviewAudio and SaveAudio, as well as every node in this pack.

    Supported formats: .wav, .mp3, .ogg, .flac, .aiff, .aif. The node also validates the input: if the path doesn't exist or the extension isn't in that list, it refuses before you even run the graph, which beats discovering the typo mid-queue.

    The one input is audio, a single-line string. Use an absolute path - relative paths resolve against wherever ComfyUI's working directory happens to be, which is a recipe for "no such file" confusion. On Windows, mind your backslashes.

    The bug you'll hit

    There's a genuine defect in the shipped 1.0.0 release, and it's the first thing to know about this node. The code's IS_CHANGED method - the thing ComfyUI calls to decide whether a node needs re-running - uses Python's hashlib module without importing it. Run the node and you'll get a NameError: name 'hashlib' is not defined instead of audio.

    The fix is a one-line patch in your install:

    # edit ComfyUI/custom_nodes/comfyui-audio-processing/io_nodes.py
    # change the top of the file from:
    #   import torchaudio
    #   import os
    # to:
    import torchaudio
    import os
    import hashlib
    

    Then restart ComfyUI. If you don't feel like patching a third-party node, the workaround is trivial: use ComfyUI's built-in Load Audio and either upload the file or copy it into input/. The path-loading convenience is the only real difference, so for a single file it's often not worth the patch.

    Installing

    cd ComfyUI/custom_nodes
    git clone https://github.com/rhdunn/comfyui-audio-processing
    

    then restart - or find "comfyui-audio-processing" in ComfyUI Manager and click install. No extra pip packages, no model downloads; it runs on the torchaudio ComfyUI already installs. Note the pack is a solo, GPL-3 project with one release (August 2024) and no updates since, so the hashlib bug is unlikely to fix itself - patch it yourself or live without this one node.

    When to reach for it

    Batch workflows, mostly. If you're looping over a folder of samples to generate spectrograms or plot waveforms, a path-based loader is what you want, and the built-in upload node simply can't do it. For everything else, the built-in is less fiddly - this node exists for the cases the built-in refuses to handle.

    Categoryaudio processing

    Inputs (1)

    NameTypeDefaultDescription
    audioSTRING

    Outputs (1)

    NameTypeDescription
    AUDIOAUDIO