Nodes/comfyui-flower-tools/🌸Flower Audio Merge
ComfyUI Node

🌸Flower Audio Merge

Stitch audio files into one track with per-file checkboxes and a seed

By weichenglin0215·Created 8 months ago·Updated 2 months ago· 0
🌸Flower Audio Merge
    • audio
    • count
    • length
    • fileName
    ◄directory►
    ◄filterKeyword►
    ◄negativeKeyword►
    ◄inputFormatSelector▾►
    ◄appendOutputName_Merge►
    ◄fileConfigs{}►
    ◄autoOutputMode▾►
    ◄seed0►
    ◄autoSegmentCount4►

    Flower Audio Merge is the odd one out in this pack - everything else is strings and filenames, and then there's this: a full audio-concatenation node with a checkbox UI. Point it at a folder of WAV/MP3/FLAC files, tick the ones you want, and it spits out a single merged ComfyUI AUDIO tensor, volume-matched and ready to save. It's the pack's answer to "I generated forty TTS clips and I want them as one track" without reaching for a DAW or a shell script.

    How it works

    The node reads the folder, filters by format (inputFormatSelector: ALL/WAV/MP3/FLAC) and by filename keyword (filterKeyword / negativeKeyword, same | OR / & AND pattern as the text nodes), and lists the survivors as ON/OFF buttons in its UI. Your checked state persists in the fileConfigs JSON widget across workflow reloads - that's the "visual checklist" part.

    When it runs, it:

    1. Resamples everything to 48 kHz stereo float32, so files of different sample rates concatenate without clicks or drift.
    2. Peak-normalizes the batch as a whole - it measures the loudest sample across all selected files and scales each track proportionally, so one quiet file doesn't bury the rest.
    3. Concatenates in fixed alphabetical order, which makes the output reproducible run to run.

    Outputs: audio (the merged AUDIO tensor), count (how many files merged), length (total seconds, two decimals), and fileName - the first selected file's name without extension, plus appendOutputName (default _Merge). That last one is the wire-up trick: the README's recommended flow sends fileName into Flower File Name Combination so your saved merge gets a sensible, searchable name.

    The seed modes (the actually clever part)

    Besides manual ticking, autoOutputMode has two "forced auto" modes that turn the node into a batch tool:

    • 強制自動依章節分段輸出 - picks the chapter group from filenames containing 第X章 (Chinese or Arabic numerals). seed=0 merges all of chapter one, seed=1 chapter two, and so on. Output filename gets a -第X章 prefix. This is made for "one audio file per paragraph, grouped into chapters" TTS output.
    • 強制自動依檔案數量分段輸出 - splits the sorted file list into batches of autoSegmentCount (default 4) and seed picks the batch: seed=0 → files 1–4, seed=1 → 5–8. Batch-through-a-novel mode.

    The seed widget also gets ComfyUI's normal post-generation control (fixed/increment/decrement/randomize), so you can step chapter by chapter automatically on a batch queue. Honestly, this is the most thought-out node in the pack - the checkbox UI is the hook, but the seed-driven chapter logic is why you'd pick it over a five-line ffmpeg loop.

    The one gotcha that will actually bite

    The pack's declared dependency list is just opencc, so torchaudio is not auto-installed with the pack. The node detects a missing import and offers a one-click install button - use it, or pip install torchaudio into your ComfyUI Python yourself. And if you save to MP3, you need ffmpeg on the system; ComfyUI Windows Portable ships with it, but a bare Linux install might not.

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/weichenglin0215/comfyui-flower-tools.git
    

    Restart, or ComfyUI Manager → search ComfyUI Flower Tools. No models to download. Remember the torchaudio dependency above.

    Wiring it up

    audio plugs straight into ComfyUI's Save Audio - the README's example fans it to both a WAV (32-bit float) and an MP3 (320k) save node simultaneously, since it's a standard AUDIO tensor. count and length are handy for logging or progress conditions. If you only merge occasionally, the manual checkboxes are fine; if you're automating audiobook chapters, set autoOutputMode to the chapter mode and drive seed from the queue - that's the mode the node was really built for.

    Categoryflower-tools

    Inputs (9)

    NameTypeDefaultDescription
    directorySTRING—
    filterKeywordSTRING—
    negativeKeywordSTRING—
    inputFormatSelectorCOMBO4 options: ALL, WAV, MP3, FLAC
    appendOutputNameSTRING_Merge—
    fileConfigsSTRING{}—
    autoOutputModeCOMBO3 options: 無強制自動輸出, 強制自動依章節分段輸出, 強制自動依檔案數量分段輸出
    seedINT00–18446744073709550000—
    autoSegmentCountINT41–9999—

    Outputs (4)

    NameTypeDescription
    audioAUDIO—
    countINT—
    lengthFLOAT—
    fileNameSTRING—