Nodes/ComfyUI-speech-dataset-toolkit/Save Audio With Sequential Numbering
ComfyUI Node

Save Audio With Sequential Numbering

Save a batch without hand-naming every file

By kale4eat·Created 2 years ago·Updated about a year ago· 23
Save Audio With Sequential Numbering
  • audio
    file_format
    filename_prefixComfyUI

    SDT_SaveAudio takes a fixed file_name, which is fine for one clip but a problem the moment you're saving many - run the graph twice and you overwrite yourself, or you have to wire up a unique name for every single output by hand. This node exists for exactly the situation a dataset toolkit cares about: splitting a long recording into chunks (VAD segments, trim splits, whatever) and saving each one out with an automatically incrementing filename instead.

    How it works

    It writes to the same output/audio_output folder the pack sets up on first launch, same as SDT_SaveAudio, but instead of an explicit file_name field, it derives the filename automatically by appending an incrementing number onto filename_prefix. Successive saves land as distinct files rather than clobbering each other - the whole point of the node.

    The inputs and outputs that matter

    • audio - the clip to save, required.
    • file_format - the same eight-format choice as SDT_SaveAudio: wav, mp3, flac, vorbis, sph, amb, amr-nb, gsm.
    • filename_prefix (default "ComfyUI") - the base name the sequence number gets appended to.

    No file_name field here - that's the deliberate difference from SDT_SaveAudio. No outputs either; this is a terminal node (is_output_node: true).

    How to install it

    Via ComfyUI Manager: search ComfyUI-speech-dataset-toolkit, install, restart. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/kale4eat/ComfyUI-speech-dataset-toolkit
    cd ComfyUI-speech-dataset-toolkit
    pip install torchaudio --index-url https://download.pytorch.org/whl/cu121
    pip install -r requirements.txt
    

    Nothing extra beyond the pack's torchaudio baseline - same as SDT_SaveAudio.

    Common issues & troubleshooting

    Can't find the saved files. Same as SDT_SaveAudio - they're written to output/audio_output, not the regular output/ root. Look for filename_prefix followed by a sequence number.

    Ran the graph twice in separate sessions and worried about collisions. If avoiding any overwrite matters for your pipeline, check output/audio_output before a big batch run rather than assuming numbering always restarts at zero - where the sequence actually picks up from (an in-session counter vs. scanning existing files) isn't something to guess at when you're about to save hundreds of clips.

    mp3/vorbis or the legacy formats (sph, amr-nb, gsm) fail to encode. Same caveat as SDT_SaveAudio - these route through backend codecs that aren't always present in a minimal torchaudio install. If wav and flac save fine but a lossy or legacy format doesn't, it's a missing codec on your backend, not this node.

    This is the node to reach for in a loop. If you're already looping over VAD chunks or trim splits and saving each one, this node is built for exactly that - no per-iteration naming logic required on your end.

    Categoryspeech-dataset-toolkit

    Inputs (3)

    NameTypeDefaultDescription
    audioAUDIO
    file_formatCOMBO8 options: wav, mp3, flac, vorbis, sph, amb, +2
    filename_prefixSTRINGComfyUI

    Outputs (0)

    No outputs