Nodes/ComfyUI-HttpRequestNodes/Base64 To Audio Node
ComfyUI Node

Base64 To Audio Node

That giant base64 WAV in your API response? Now it's playable audio.

By ahkimkoo·Created 3 months ago·Updated 3 months ago· 1
Base64 To Audio Node
    • audio
    base64_string

    Some audio APIs don't return a file - they return a giant base64 string inside their JSON. The Base64 To Audio Node is the newest node in ComfyUI-HttpRequestNodes, and it exists for exactly that: you paste (or wire in) a base64-encoded WAV string, and it decodes it into ComfyUI's AUDIO type so you can play it with PreviewAudio or save it with SaveAudio. It's the missing bridge between "the API gave me text" and "I want to hear it."

    It's a natural companion to the pack's Image To Base64 Node - same trick, audio side - and it fills a real gap: until this node shipped, a base64 WAV response had to leave the graph to be converted. The base64 string most often comes from the json output of a Rest Api Node or Post Request Node (many TTS endpoints inline audio as base64 rather than serving a binary file), but the input is a plain multiline text box, so you can paste one manually to test.

    How it works

    One input, base64_string (STRING, multiline), one output, audio (AUDIO). The source is short and honest: base64.b64decode the string, read it as float32 with soundfile, reshape into the [batch, channels, samples] waveform shape ComfyUI expects, and return it with the detected sample rate.

    A few practical notes. It decodes WAV - that's what soundfile reads here, so a base64 MP3 will fail. Mono input is handled (reshaped to one channel), and multi-channel comes through as-is. There's no equivalent "Audio To Base64" node in this pack, so you won't be round-tripping with it in-graph - the base64 usually originates from a server response or an external tool. And the usual decode-side gotcha applies in reverse: make sure the string is just the base64. If the API wraps it as data:audio/wav;base64,..., strip the prefix before feeding it in, or the decoder chokes.

    Install

    ComfyUI Manager → search ComfyUI-HttpRequestNodes → Install, restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ahkimkoo/ComfyUI-HttpRequestNodes
    pip install soundfile imageio imageio-ffmpeg
    

    Category: RequestNode/Converters. soundfile is the one real dependency - same package the pack's audio encoders need, so if you've installed those, this is covered. No models, no keys.

    CategoryRequestNode/Converters

    Inputs (1)

    NameTypeDefaultDescription
    base64_stringSTRING

    Outputs (1)

    NameTypeDescription
    audioAUDIO