Nodes/APZmedia Qwen TTS Nodes/APZmedia: Audio Saver
ComfyUI Node

APZmedia: Audio Saver

Save audio where you want, named how you want

By APZmedia·Created 5 months ago·Updated 5 months ago· 1
APZmedia: Audio Saver
  • audio
    output_path
    filename_template{datetime}_{speaker}_{text_preview}.wav
    sample_rate24000
    speakerspeaker
    text_previewpreview
    seed0

    The last node in the pack and the one every generated line passes through eventually. APZmedia: Audio Saver writes a ComfyUI AUDIO to disk as a WAV file - but it earns its keep with the filename template, which lets you name files based on who's speaking, what they said, and the seed, instead of dumping everything into a folder of 00001_00001_.wav nonsense.

    The mechanism is simple: take the audio input, optionally resample it to your chosen sample_rate, and write it with soundfile to output_path using a template string. The token expansion is where the personality is:

    | Token | Expands to | |-------|-----------| | {date} | 20260329 | | {datetime} | 20260329_143022 | | {speaker} | value of the speaker input | | {text_preview} | first ~40 chars of text_preview, sanitized | | {seed} | the seed as a string |

    Default template: {datetime}_{speaker}_{text_preview}.wav. So wire speaker from wherever your workflow knows the character (a constant, or the output of a voice-design pass) and text_preview from your text node, and your output folder reads like a script. The saver sanitizes everything that goes into a filename - illegal characters become underscores, and a .wav is appended if your template forgot it - so you won't get files ComfyUI can't save.

    Inputs

    • audio - the AUDIO to save, from any generation node in this pack.
    • output_path - absolute folder. Empty uses ComfyUI's output directory, which is the sensible default.
    • filename_template - the tokens above. This is the knob you'll actually care about.
    • sample_rate - default 24000, range 8000–48000. The pack's models output 24000 Hz; leave it alone unless a downstream tool wants something else. It resamples when needed.
    • speaker, text_preview, seed - the fuel for the template. All optional; there are defaults so an unconnected template still resolves.

    It's an output node - no outputs, it just writes the file. The console prints the saved path, which is handy for finding where "absolute path" actually went.

    Gotchas

    Two things trip people up. First, output_path is a plain string field and ~/Downloads/ does get expanded, but a relative path won't be - it's used as-is against your current working directory, so give it an absolute path or leave it empty. Second, if you're batch-generating many lines into one run, {datetime} is resolved at save time and two saves in the same second collide - throw {speaker} or {seed} into the template to keep filenames unique. That's the classic "why are my files overwriting each other" gotcha, and the template is the intended fix.

    Install is the pack-wide clone: git clone https://github.com/APZmedia/ComfyUI-APZmedia-qwen-TTS into ComfyUI/custom_nodes, restart. No model download needed for this node alone, since it never touches the GPU - but you're installing the whole pack anyway, so you'll get the loaders with it.

    CategoryAPZmedia/TTS

    Inputs (7)

    NameTypeDefaultDescription
    audioAUDIO
    output_pathSTRINGAbsolute directory to write WAV files. Empty uses ComfyUI output.
    filename_templateSTRING{datetime}_{speaker}_{text_preview}.wavTokens: {date}, {datetime}, {speaker}, {text_preview}, {seed}
    sample_rateINT240008000–48000
    speakeroptSTRINGspeaker
    text_previewoptSTRINGpreview
    seedoptINT00–2147483647

    Outputs (0)

    No outputs