Audio Loader Crawl (CRT)
Grab a random audio file from a folder, deterministically
- audio
- file_name
- file_path
If you've batch-processed images in ComfyUI, "crawl a folder and pick a file by seed" is a pattern you already know - CRT-Nodes has the same trick for images (Image Loader Crawl) and applies it to audio here. Instead of hardcoding one file path, you point this node at a folder and let it pick a file for you, reproducibly, based on a seed rather than truly at random.
What it's for
This is a dataset/batch-processing node more than a one-off loader. If you've got a folder of background music, sound effects, or voice samples and you want your workflow to pull a different one each run - but still be able to reproduce a specific pick later by reusing the same seed - this is the node for it. It also handles the trimming and gain-staging you'd otherwise bolt on separately: start offset, max length, and a gain adjustment are all built in, so you can go from "a folder of raw audio files" to "a properly leveled clip of the right length" in one node.
The inputs and outputs that matter
All required, all with tooltips straight from the node itself:
folder_path- "Path to the folder containing audio files."seed- "Seed for deterministic file selection." Same seed, same folder contents, same file picked every time - this is what makes "random" here actually reproducible.file_extension- enum ofwav,mp3,flac,ogg(defaultwav), "File extension to filter for."crawl_subfolders(default false) - "If true, include files in subfolders."remove_extension(default false) - "Output filename without extension," for when you want the clean name for a save path or label rather thanmyfile.wav.max_length_seconds(default 0, meaning no limit) - "Maximum length of the audio in seconds (0 for no limit)."start_offset_seconds(default 0) - "Start loading the audio from this offset in seconds," useful for skipping a silent intro or a specific section of a longer file.gain_db(default 0, range −120 to 120) - "Gain in decibels (dB)," applied on load.
Outputs: audio, file_name (STRING), and file_path (STRING) - both string outputs are handy for logging which file got picked, or for feeding into a save node so your output filename references the source clip.
Installing it
One of eleven nodes in CRT-Nodes' CRT/Load category, alongside its image and video/text crawl counterparts - the "pick a random file from a folder by seed" pattern repeats across several media types in this pack, all bundled in PGCRT's larger CRT-Nodes suite.
ComfyUI Manager - search CRT-Nodes, install, restart.
Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/PGCRT/CRT-Nodes.git
pip install -r requirements.txt
Restart ComfyUI. Audio decode/gain here runs on librosa and imageio-ffmpeg from the pack's base requirements - nothing extra needed for this node specifically.
Common issues
- Same seed picks a different file after adding or removing audio files from the folder - this is expected, not a bug. The selection is deterministic relative to the folder's current contents, so any change to the file list can shift what a given seed resolves to. If reproducibility across time matters, keep the source folder frozen once you've locked in a seed.
- Nothing loads, or an error about no matching files - check
file_extensionactually matches what's in the folder; it's a strict filter, and a folder of.m4afiles under awavfilter will come up empty. - Subfolder files never get picked -
crawl_subfoldersdefaults tofalse. If your audio is organized into subdirectories, you need to flip that on explicitly. - Clip is louder or quieter than expected - check
gain_dbisn't left at a nonzero value from a previous tweak; it's an absolute adjustment applied every load, not a one-time normalization.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| folder_path | STRING | Path to the folder containing audio files | |
| seed | INT | 00–18446744073709550000 | Seed for deterministic file selection |
| file_extension | COMBO | wav | File extension to filter for |
| crawl_subfolders | BOOLEAN | false | If true, include files in subfolders |
| remove_extension | BOOLEAN | false | Output filename without extension |
| max_length_seconds | FLOAT | 0.0 | Maximum length of the audio in seconds (0 for no limit) |
| start_offset_seconds | FLOAT | 0.0 | Start loading the audio from this offset in seconds |
| gain_db | FLOAT | 0.0-120–120 | Gain in decibels (dB) |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| audio | AUDIO | — |
| file_name | STRING | — |
| file_path | STRING | — |