Nodes/Comfy-Pack/Audio Output
ComfyUI Node

Audio Output

The pack's quietest node, and the one with hidden dependencies

By bentoml·Created 2 years ago·Updated 10 months ago· 217
Audio Output
  • audio
    filename_prefixaudio/comfypack

    Audio Output is the Comfy-Pack node nobody talks about, because barely anyone uses it. That's a shame - if you're building a served workflow that produces sound (TTS, music-gen, sound-effect pipelines), this is the node that turns your AUDIO tensor into a file and marks it as an API output so the served endpoint returns it.

    Comfy-Pack, for the uninitiated, is BentoML's toolkit for making ComfyUI workflows shareable and deployable. You annotate graph inputs and outputs with ComfyPack nodes, then either package the whole environment as a .cpack.zip or serve the workflow as a REST API at http://127.0.0.1:3000/generate. Audio Output is the annotator for the audio half of that story.

    How it works

    It takes an AUDIO tensor - which in ComfyUI is a dict carrying a waveform and a sample_rate - and writes a real audio file to your output directory. Under the hood it doesn't just dump bytes: it re-encodes through PyAV so it can stamp the workflow prompt and extra metadata into the container itself. The shipped code can write a few container formats (flac, mp3, and opus are all handled, with opus getting the sample-rate babysitting that codec famously requires), and it resamples when the target format demands a supported rate.

    The inputs that matter

    The node's exposed surface is deliberately small:

    • audio - the AUDIO tensor from whatever is generating your sound.
    • filename_prefix - default audio/comfypack. Change it to something meaningful, because the file name becomes yourprefix_NNNNN.flac style in your output folder.

    That's it. There are more knobs in the code than are exposed to the UI, which is a reminder that this node is new and lightly developed. It works, but it's not feature-complete the way Comfy-Pack's image and video outputs are.

    Install

    It ships with the whole pack, so the install is the pack install:

    • ComfyUI Manager: search comfy-pack, Install, restart, refresh.
    • Manual: cd ComfyUI/custom_nodes && git clone https://github.com/bentoml/comfy-pack, restart.

    Here's where the real gotcha lives. The node calls import av (PyAV) and import torchaudio at save time, but neither is in the pack's requirements. The pack's dependencies are BentoML, comfy-cli, fastapi and friends - audio is an afterthought. So if you installed via Manager and your environment happens to be missing PyAV, saving an audio file throws ModuleNotFoundError: No module named 'av' right in the middle of your run.

    The fix is boring and one line:

    pip install av torchaudio
    

    Then restart ComfyUI. This is the single most common reason Audio Output "doesn't work," and it has nothing to do with the node itself.

    Should you reach for it?

    If you only generate images, you'll never touch this node - it exists so served workflows can return audio files. If you are serving audio workflows, it's the right call because it's the one the API understands. Just remember the hidden dependency, and don't expect format options galore. For heavy local audio work (mixing, fancy containers), keep your usual audio tools and let this node be the thin API-facing final step.

    CategoryComfyPack/output

    Inputs (2)

    NameTypeDefaultDescription
    audioAUDIO
    filename_prefixSTRINGaudio/comfypack

    Outputs (0)

    No outputs