Nodes/ComfyUI-SoundHub/Preview Audio
ComfyUI Node

Preview Audio

Actually hear what you generated, before you save it

By Yuan-ManX·Created 2 years ago·Updated 2 years ago· 4
Preview Audio
  • audio
  • sample_rate

    The fastest way to tell whether a generated clip's audio is garbage is to hear it, and ComfyUI's graph doesn't exactly hand you a speaker. Preview Audio - the third node in the tiny ComfyUI-SoundHub pack - is that speaker. It takes the pack's AUDIO tensor plus its sample rate and puts a playable audio widget right on the node, so you can listen without saving a file, opening a folder, and hunting for it.

    How it works

    Preview Audio is a terminal output node with exactly two inputs and no outputs. Give it audio and a sample rate and it validates the tensor is a sane one- or two-channel waveform, writes a temporary .wav into ComfyUI's temp directory (with a random prefix so previews don't collide), and hands the path to the frontend. A player shows up on the node; nothing touches your output/ folder. It's deliberately fire-and-forget - the files accumulate in temp and get cleaned up whenever ComfyUI decides temp is disposable.

    That makes it a great debugging node as much as a final one. Drop it mid-graph to hear what an intermediate stage actually produced instead of assuming, then swap it for Save Audio once you're happy. Load Audio → whatever processing → Preview Audio is the whole pack's loop, and it works.

    The inputs (all two of them)

    • audio - the pack's AUDIO tensor.
    • sample_rate - needed because the node can't infer it; wire it through from Load Audio's sample_rate output.

    Both come out of Load Audio together, so in practice this is two wires and done.

    Installing it

    Same pack, same install as the other two:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Yuan-ManX/ComfyUI-SoundHub.git
    cd ComfyUI-SoundHub
    pip install -r requirements.txt
    

    Restart, look for the "SoundHub" category. Or search "ComfyUI-SoundHub" in ComfyUI Manager. No models, no checkpoints, nothing heavy to download - the only package that might trip you up is librosa in requirements, which the code doesn't even use, so you can safely delete that line if pip complains.

    Troubleshooting

    • "Audio must be mono or stereo" error - you fed it something with more than two channels or a weird shape. Load Audio's output is safe; if you built the tensor yourself, check the dimensions.
    • No player appears - it happens if the preview path can't reach the frontend, usually an environment quirk rather than a node bug; re-running or refreshing the page usually fixes it.
    • Temp files piling up - expected behavior. They're temp for a reason.

    There's not much to say about a node this simple, which is the point: you'll spend more time listening than configuring.

    CategorySoundHub

    Inputs (2)

    NameTypeDefaultDescription
    audioAUDIO
    sample_rateSAMPLE_RATE

    Outputs (0)

    No outputs