LoRA List Directory (CCN)
LoRA List Directory (CCN)
- lora_names
- total_count
LoRA List Directory (CCN) is the reconnaissance node for LoRA batch work. It scans a folder under your LoRA directory and hands you two things: a newline-separated list of every LoRA file in it, and a count. It doesn't load anything, it doesn't patch anything - it's a read-only inventory, and its whole reason to exist is to sit upstream of LoRA Loader By Index (CCN) in the same pack so you know what you're about to sweep before you sweep it.
Here's the workflow it's built for. Say you have a character subfolder with 40 LoRAs and you want to run the same base prompt against each one to see which works. You wire a Loader By Index with index from a counter, and now you need to know: how many iterations before it wraps? How should the counter be set up? total_count from this node answers that directly - 40 LoRAs means 40 runs. And lora_names gives you the actual list, which you can pipe into a text display or a string-splitter if you want to build a human-readable record of what was tested.
Mechanically it's a filesystem walk with a filter. Give it a subdirectory (relative to your LoRA root, e.g. wan/characters or new_loras) and it lists .safetensors, .pt, .bin, and .ckpt files. The recursive toggle controls whether it descends into subfolders; when on, names come back as relative paths (style/film/something.safetensors) so you can feed them back into index loaders that understand subdirectories. Leave subdirectory empty and it inventories your whole LoRA root, sorted alphabetically either way.
The two outputs are lora_names (one per line, as a single STRING) and total_count (an INT). That's the entire API, and it's enough.
Install
ComfyUI Manager, search "ComfyCollectorNodes", install - or:
cd ComfyUI/custom_nodes
git clone https://github.com/valkymaera/ComfyCollectorNodes
Restart ComfyUI, look under ComfyCollectorNodes → Loaders for "LoRA List Directory (CCN)". No dependencies beyond stock ComfyUI, no model files, MIT license.
Common issues
The one thing that bites people: it only looks at your first configured LoRA path. ComfyUI supports extra LoRA roots via extra_model_paths.yaml, and this node reads folder_paths.get_folder_paths("loras")[0] - the primary one. If your LoRAs live on a second drive configured through extra paths, point subdirectory at a folder that exists under your primary LoRA root, or this node reports "Directory not found". (By contrast, Loader By Index searches all configured paths, so the pair can disagree about where things are - worth knowing when you're debugging an empty list.) Also: it's case-insensitive on extensions but not on folder names, so Wan/Characters won't match wan/characters on Linux.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| subdirectory | STRING | — | |
| recursive | BOOLEAN | false | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| lora_names | STRING | — |
| total_count | INT | — |