Nodes/ComfyUI-aihub-workflow-exposer/AIHub Action New Audio
ComfyUI Node

AIHub Action New Audio

The node that hands a generated audio clip back to whatever app called ComfyUI

By otavanopisto·Created about a year ago·Updated 22 days ago· 7
AIHub Action New Audio
  • audio
    actionAPPEND
    namenew audio
    formatwav
    file_name
    autoplayfalse

    AIHub Action New Audio is the outbox of this pack. If you're running a ComfyUI workflow that produces an AUDIO tensor - generated music, a voice-over, an SFX pass - this is the node you put at the end to ship the finished clip back to the application that launched the run. Without a node like this, your audio just sits inside ComfyUI. With it, an external editor or web client receives the actual file, ready to be placed on a timeline.

    Before you go further, know what this pack is, because it explains half of what this node does. otavanopisto's ComfyUI-aihub-workflow-exposer turns ComfyUI into the compute engine inside another app. The "expose" nodes pull data in from the client; the "action" nodes push results back out, over a separate websocket (port 8111 by default) that the pack runs alongside ComfyUI's normal one. Nothing here is designed to be pretty inside the stock web UI - it's a bridge, not a pipeline.

    How it works

    When this node runs, it grabs the waveform and sample_rate out of the AUDIO dict, encodes it with torchaudio into your chosen format (wav, ogg, or flac), and streams the bytes to the connected client under a NEW_AUDIO event. The JSON envelope carries the name, file_name, and an autoplay flag so the client knows what to do with it.

    The inputs that matter

    • audio (required) - the AUDIO tensor. Wire it from whatever generated the sound (a music-gen node, a voice pipeline, a saved-file loader).
    • action - APPEND or REPLACE. Append tags a number onto the filename when one already exists, so you keep every clip; replace clobbers the old file. For a one-shot "generate and send" this rarely matters, but if a client is building up a library of takes, APPEND is your friend.
    • name - the friendly name the client shows. Also used to build the filename if you don't override it.
    • format - wav, ogg, or flac. WAV is the safe default; ogg/flac are there if you're worried about size.
    • file_name - optional override with the extension already included. Leave it empty and the node builds one from name plus the format.
    • autoplay - whether the client should start playing it immediately. For preview loops, true; for batch export, probably false.

    It has no outputs. This is a pure side-effect node: it exists to send data out of the graph, not to feed anything downstream.

    Installing it

    Install via ComfyUI Manager (search "ComfyUI-aihub-workflow-exposer") and restart, or by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/otavanopisto/ComfyUI-aihub-workflow-exposer
    # restart ComfyUI
    

    There's no requirements.txt and nothing to download - the pack deliberately reuses what ComfyUI already ships (torch, torchaudio, safetensors, Pillow). The pack's server creates the ComfyUI/aihub/ folder structure it wants on first launch.

    Where people get burned

    The number one confusion: you run this in the stock web UI and "nothing happens." That's expected. The node sends the audio over the pack's separate websocket to a client that has to be listening. If you're not running one of the aihub client apps, this node is a silent no-op from your point of view - the run succeeds, nothing appears. And if the audio input is empty, it just returns early, again without complaint. So the real troubleshooting question is never "is the node broken" but "is something connected on the other end."

    Categoryaihub/actions

    Inputs (6)

    NameTypeDefaultDescription
    audioAUDIO
    actionCOMBOAPPENDIf append is selected, the audio will be added a number to the name to make it unique, if replace is selected, the audio will be replaced with the new one
    nameSTRINGnew audioThe name of the audio to be used
    formatoptCOMBOwavThe format to save the audio in
    file_nameoptSTRINGThe filename to use, with the extension, if not given the name value will be used with the given format extension
    autoplayoptBOOLEANfalseIf true, the audio will autoplay when added

    Outputs (0)

    No outputs