Donut LoRA Library Manager
Your CivitAI metadata cache, managed
- output
Every time the pack's CivitAI lookup nodes resolve a LoRA, they stash the metadata and preview image in a local cache so they don't re-ask the API. DonutLoRALibrary is the dashboard for that cache - a small admin node that shows you what's stored, scans your whole loras folder to build it out, and clears it when things go stale. It's not glamorous, but if you run the Donut CivitAI nodes at all, this is the one that keeps them honest.
The actions
One required input, action, with four operations:
- Show Stats - cached model count, preview-image count, total cache size in MB, and the cache directory. The "how big is this getting" check.
- List Cached - dumps the cached models by name (and version) so you can see what's already resolved without a single API call.
- Scan All LoRAs - the interesting one. It walks every file in
models/loras, computes each hash (using the cached hash where possible), and fetches metadata for anything not already cached. You get a running log of+ name -> display name,- name [not found], and! name [error], with a summary line at the end. This is the bulk-inventory pass - run it once after installing the pack and your whole folder is pre-resolved. - Clear Cache - wipes the metadata and preview cache. The fix when a hash lookup is serving stale info after you've re-exported or replaced a LoRA file.
There's also an optional api_key, which Scan All LoRAs uses for the bulk fetch - hand it your CivitAI key if you're scanning a big folder, since you'll be hitting the API for every uncached file.
Output is a single output STRING carrying the report. It's an output node, so it's the end of a branch - wire it into a text display if you want to read it in the UI.
How it works
All four actions route through the shared CivitAICache in the pack's shared/civitai_api.py - the same cache the lookup nodes read and write. That's the key thing to understand: this node isn't a separate library, it's a control panel for the lookups. Scan All LoRAs reuses the exact hash-compute and fetch path the per-file lookup uses, just looped.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/DonutsDelivery/ComfyUI-DonutNodes.git donutnodes
cd donutnodes
python -m pip install -r requirements.txt
or ComfyUI Manager → "DonutNodes," restart.
Using it well
Best practice: install the pack, drop this in a scratch graph, run Scan All LoRAs once overnight (or whenever) with your API key in, then let the lookups ride the cache. One gotcha from the source: "Scan All LoRAs" skips files whose hash is already cached - so if you've updated a LoRA file, Clear Cache first or the scan will miss the new version. And if you ever see the pack behaving like it has the wrong metadata for a file, this is the first place to look.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| action | COMBO | 4 options: Show Stats, List Cached, Scan All LoRAs, Clear Cache | |
| api_keyopt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| output | STRING | — |