๐ธ Library LoRA Remapper
Moved your LoRAs into folders and broke every saved prompt? One run fixes it
- report
We've all done it. Your LoRA folder started as a flat pile of 400 .safetensors files, you got organized, and you spent an afternoon sorting them into anime/, styles/, realistic/ subfolders. Then you opened your prompt library and half your saved workflows silently point at LoRA paths that no longer exist. The ๐ธ Library LoRA Remapper exists for exactly that afternoon.
It scans your prompt library for broken LoRA references - entries whose stored file path no longer resolves - and rewrites them to the file's new location, automatically. It's from FrogUtilityTools, the maintenance companion pack for ๐ธ Frog Node Pack, and it works with anything that keeps a data/prompts.json library. No API, no model downloads, no neural networks involved. Just file bookkeeping, done in one pass instead of by hand.
How it works
The node locates the library's prompts.json (it checks FrogNodePack, the older Ribbity_Node_Suite / RibbityNodeSuite folders, then falls back to scanning all custom nodes for one). Then it does two things:
- Walks your LoRA root folder recursively and builds a lookup map of every
.safetensors,.pt, and.ckptfile, keyed by filename. - Goes entry by entry through the library. If a LoRA's stored path still resolves, it's left alone. If not, the node tries to find a file with the same basename in your LoRA root - and if it finds one, it rewrites the reference to the new relative path.
Only actual moves are fixed. A file that was moved and renamed won't match, because the matching is by filename. That's the one real limitation, and it's worth knowing before you run this expecting miracles.
The report output gives you per-file โ REMAP and โ NOT FOUND lines plus totals: refs scanned, already OK, remapped, missing. If a file can't be found anywhere, it tells you by name - that's your to-do list for LoRAs you genuinely deleted.
The inputs that matter
Only two, and both are set-and-run:
lora_root- your ComfyUI LoRA root folder, e.g.ComfyUI/models/loras. It's scanned recursively, so subfolders are fine. On Windows, paste the path with forward slashes or quote it.dry_run- defaults to ON. ON means preview only; OFF means actually apply the remaps.
Just like its sibling Library Culler, this node defaults to the safe mode. It also refuses to save unless at least one remap happened, and before writing anything it backs up prompts.json to <pack>/Patches/Backup/prompts_BackUp.json. The save itself is atomic (temp file + replace), so a crash mid-write won't corrupt your library.
Install
Zero dependencies - it's pure Python from the standard library, no pip step, no models. Either ComfyUI Manager (search "FrogUtilityTools") or:
cd ComfyUI/custom_nodes
git clone https://github.com/RabbitThatIsPink/FrogUtilityTools
Restart ComfyUI; the nodes land under ๐ธ Frog Utility Tools. Python 3.10+, ComfyUI Desktop and Windows Portable supported.
Troubleshooting
- "ERROR: No LoRA root folder provided." / "LoRA root not found" - check
lora_rootactually points at yourlorasfolder and the path is correct. - "Could not find prompts.json." - the node scans for a
data/prompts.jsonin known packs. If yours lives elsewhere or the pack folder was renamed, it won't find it. - The classic trap: two LoRAs with the same basename in different subfolders. The filename map can only store one match per name, so the ambiguous one may be remapped to the wrong folder. If you have duplicates like that, rename one before running.
- After a live run, the report tells you to refresh the library node's gallery so it picks up the new paths.
Run it with dry_run ON first, read the report, then flip it off and let it fix your library. That "one afternoon" of organizing shouldn't cost you a weekend of broken workflows.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| lora_root | STRING | Your ComfyUI LoRA root folder. Will be scanned to find moved files by filename. | |
| dry_run | BOOLEAN | true | ON = preview only. OFF = apply remaps to library. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| report | STRING | โ |