LoRA Folder Batch
Test Every LoRA Epoch Without Rebuilding Your Graph
- lora_params
- lora_list
- lora_count
Every LoRA training run ends the same way: twenty checkpoint files from twenty epochs, and the best one is never the last one. LoRA Folder Batch is built for exactly that moment. Point it at a folder of .safetensors LoRAs, tell it the strengths you want to test, and it generates a batch of LoRA-parameter sets you can sweep through - epoch by epoch, strength by strength - without hand-plugging each file into a LoRA loader.
How it works
It scans a folder for .safetensors files (relative to your models/loras directory, or an absolute path), then applies filters and sorts before generating params. The natural-sorting detail is the one that shows someone actually trained models: it sorts by epoch number, so epoch_004 comes before epoch_020 - alphabetical sort would put epoch_020 first and your sweep would be garbage. You can also sort alphabetically, newest, or oldest.
Strengths are a flexible string: "1.0" for a single value, "0.5,0.75,1.0" for a list, or "0.5...1.0+0.1" for a range sweep. batch_mode controls the combinatorics: sequential pairs each LoRA with one strength, combinatorial tries every strength on every LoRA (that's the exhaustive sweep, and it multiplies your run count fast). Regex include_pattern / exclude_pattern fields let you slice the folder down to, say, the character LoRAs and skip the style ones.
Inputs and outputs
The ones that matter:
- folder_path - relative to
models/loras(default.), or absolute. - strength - single value, comma list, or
start...end+steprange. - batch_mode - sequential or combinatorial.
- max_loras - cap, default 50, to stop a giant folder from flooding your UI.
- auto_batch / batch_size / batch_index - for chunking huge sets into groups of 25 (default) so the UI doesn't choke.
Outputs: lora_params (the batch, meant for the pack's Flux Sampler Params), lora_list (a readable list), and lora_count (how many made it through).
Where it fits
This is the "find the best epoch" tool, and the training lore backs it up: intermediate epochs are routinely better than the final one, so testing all of them is not optional paranoia. It's also the strength-sweep workhorse - you'll often find a LoRA that "doesn't work" just wants 0.4 instead of 1.0. It's part of the pack's xyz-helpers family (descended from cubiq's ComfyUI_essentials), so it's designed to feed the pack's parameter-testing plumbing, not a stock LoRA loader.
Installing it
ComfyUI Manager β "ComfyUI-KikoTools" β Install β restart, under ComfyAssets β xyz-helpers. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/ComfyAssets/ComfyUI-KikoTools.git
cd ComfyUI-KikoTools
pip install -r requirements.txt
Restart ComfyUI.
Gotchas
Watch the run-count explosion: combinatorial mode across 20 epochs Γ 3 strengths is 60 generations - plan accordingly or use the max_loras / batch_index chunking to eat it in pieces. If you also have the original ComfyUI_essentials installed, the shared lineage can surface duplicate node names; ComfyUI Manager usually flags it. And remember the folder path is relative to models/loras by default - put your training output there (or give an absolute path), or the scan comes back empty.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| folder_path | STRING | . | Folder path relative to models/loras (or absolute path) |
| strength | STRING | 1.0 | Strength values (e.g., '1.0' or '0.5,0.75,1.0' or '0.5...1.0+0.1') |
| batch_mode | COMBO | sequential | Sequential: one strength per LoRA, Combinatorial: all strengths for each LoRA |
| include_patternopt | STRING | Regex pattern to include files (empty = all) | |
| exclude_patternopt | STRING | Regex pattern to exclude files (e.g., 'test|backup') | |
| max_lorasopt | INT | 501β500 | Maximum number of LoRAs to process (to prevent UI disconnection) |
| auto_batchopt | COMBO | disabled | Auto-batch large sets into chunks of 25 LoRAs |
| batch_sizeopt | INT | 255β100 | Number of LoRAs per batch when auto-batching |
| batch_indexopt | INT | 00β100 | Which batch to output (0-based index) |
| sort_orderopt | COMBO | natural | How to sort the LoRA files |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| lora_params | LORA_PARAMS | β |
| lora_list | STRING | β |
| lora_count | INT | β |