Nodes/comfyui-save-exact/Save Audio (Exact Filename)
ComfyUI Node

Save Audio (Exact Filename)

SaveAudioExact Without the Counter

By windskyer·Created 2 months ago·Updated 2 months ago· 0
Save Audio (Exact Filename)
  • audio
    filename_prefix
    filename
    formatflac
    overwritetrue

    Audio was bolted onto ComfyUI after the fact, and it shows: the audio tools are real (ACE-Step for music, Chatterbox for voices, MMAudio for foley), but the plumbing around them is thinner than the image side and the save options have the same counter-in-the-filename habit that plagues SaveImage. SaveAudioExact fixes the one part that's actually annoying: the filename. Feed it your AUDIO object, give it a name, get that name on disk. No track_00001_.flac.

    It's a genuinely thin node - like its siblings in this pack it's "exact filenames, nothing else" - but that niche matters more than it sounds. If you're generating a voice track with Chatterbox and then feeding it into a lip-sync video pipeline, you want to know exactly what the file is called so the next stage can find it. Predictable paths beat "parse the output folder" every time.

    How it encodes

    The AUDIO input is a dict holding waveform (a [batch, channels, samples] tensor) plus sample_rate, and the node encodes it with PyAV - the same library ComfyUI's own SaveAudio uses. That's a deliberate choice with a real payoff: it sidesteps the torchaudio save backend entirely, and torchaudio >= 2.9 needs a separate torchcodec install to save files at all. If you've hit that "torchaudio can't save audio" wall, this node's approach dodges it completely.

    Three formats, default flac:

    • flac - lossless, the default, use it for masters
    • wav - also lossless, bigger
    • mp3 - lossy, for deliverables

    Two details worth knowing. It handles mono vs stereo properly - PyAV defaults streams to stereo, so a mono track can silently get upmixed to two channels if you don't tell it otherwise; this node sets the layout explicitly, so your mono track stays mono. And like the image node, a batch of audio clips saves as name_0, name_1, etc., while a single clip keeps the clean name. The overwrite toggle defaults on; flip it off and a name collision raises an error instead of silently clobbering your earlier take.

    The inputs that matter

    • audio - the AUDIO object from your TTS or music generation node.
    • filename_prefix - subfolder under ComfyUI/output/. Empty = root.
    • filename - your exact name; give it an extension and it's honored, otherwise the format drop-down adds it.
    • format - flac / wav / mp3.
    • overwrite - default on.

    Output node, nothing comes back, your file lands in output/.

    Install and gotchas

    Standard for this pack - tiny repo, no models, no heavy deps:

    cd ComfyUI/custom_nodes
    git clone https://github.com/windskyer/comfyui-save-exact
    

    Restart ComfyUI, or grab it via ComfyUI Manager by searching "comfyui-save-exact." Requirements are just numpy, Pillow, and av, all of which a current ComfyUI already has.

    One honest caveat: the mp3 encoder is libmp3lame, whatever your PyAV build happened to ship with. If mp3 throws a codec error, it's the build, not you - flac and wav always work, so those are the safe defaults and mp3 is the convenience option. Everything else is "type the name, get the file," which after a dozen counter-suffixed renders feels like a luxury.

    Categoryaudio

    Inputs (5)

    NameTypeDefaultDescription
    audioAUDIO
    filename_prefixSTRING
    filenameoptSTRING
    formatoptCOMBOflac3 options: flac, wav, mp3
    overwriteoptBOOLEANtrue

    Outputs (0)

    No outputs