Nodes/ComfyUI-FolderBatch/FolderBatch Audio Queue
ComfyUI Node

FolderBatch Audio Queue

Batch a folder of audio through ComfyUI one clip at a time

By aiai-r·Created 8 months ago·Updated about a month ago· 3
FolderBatch Audio Queue
    • audio_path
    • file_name
    • audio_count
    folder
    extension*.mp3;*.wav;*.flac;*.m4a;*.ogg;*.aac
    start_at0
    auto_queuetrue
    sort_byName
    order_byA-Z
    audio_count0
    progress0.000

    Audio is the newest, thinnest layer in ComfyUI's stack - there's no core "batch through this folder" node for it, and the audio you actually work with tends to arrive as a pile of files rather than one clip. FolderBatch Audio Queue is the pack's answer for that pile: it scans a folder, hands you one audio_path per execution, and auto-advances until every file's been through your graph. Batch TTS review, batch cleanup, batch sound-design processing - this is the iterator that makes those hands-free.

    Same family mechanic as the image and video queues, so if you've used one you know the drill. First run globs the folder and caches the sorted list. Each execution returns the file at start_at; the frontend bumps start_at and, with auto_queue on, queues the next run automatically, resetting to zero when you hit the end. Run, advance, re-queue, repeat.

    The inputs mirror the other queues: folder (absolute path), extension - and this one ships a useful default, *.mp3;*.wav;*.flac;*.m4a;*.ogg;*.aac, so you cover the common formats without touching it. start_at for resuming, sort_by (Name/Date/Random), order_by (A-Z/Z-A). The audio_count and progress optional inputs are UI display only, fed by the node's own frontend code.

    Outputs: audio_path (current file's full path), file_name (base name, no extension - handy for naming outputs), and audio_count (total matches). The standard wiring is audio_path into FolderBatch Load Audio, whose audio output then feeds whatever audio processor you're running - MMAudio-style pipelines, lip-sync, TTS review, you name it.

    Installing follows the pack: ComfyUI Manager, search "ComfyUI-FolderBatch", restart, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/aiai-r/ComfyUI-FolderBatch
    

    No models to download, no extra Python dependencies declared. Worth knowing before you get deep: the actual decoding happens downstream in Load Audio, via PyAV - which ComfyUI already bundles - so this node is cheap; it just hands out paths.

    The queue-family gotchas apply unchanged: the file list is cached per node instance (new files mid-run won't appear until the cache resets), auto_queue needs the web UI since it's the frontend calling queuePrompt(), and an empty folder yields an empty string plus a zero count instead of an error. If a file is in the folder but isn't listed, check your extension string - a single comma instead of a semicolon between patterns quietly breaks the match.

    CategoryFolderBatch/Audio

    Inputs (8)

    NameTypeDefaultDescription
    folderSTRING
    extensionSTRING*.mp3;*.wav;*.flac;*.m4a;*.ogg;*.aac
    start_atINT0
    auto_queueBOOLEANtrue
    sort_byCOMBOName3 options: Name, Date, Random
    order_byCOMBOA-Z2 options: A-Z, Z-A
    audio_countoptINT0
    progressoptFLOAT0.0000–1

    Outputs (3)

    NameTypeDescription
    audio_pathSTRING
    file_nameSTRING
    audio_countINT