Kw_Json_Lora_CivitAIDownloader
Let your workflow download its own LoRAs from a JSON manifest
- Json Lora
- checkpoint
- Positive
- Nagative
The name is the whole pitch: you paste in a JSON list of CivitAI models and this node goes and downloads them into your ComfyUI models folder. That's useful on its own, but the interesting part is that it's one half of a pair. The same JSON flows out the other side, enriched with paths, straight into the pack's companion node Kw_JsonLoraLoader. Hand someone a workflow and one JSON string and they don't have to hunt down five LoRA pages and guess which folders to drop files in - the workflow fetches its own models.
That's a real itch. The eternal ComfyUI complaint is that you spend most of your time "downloading models and installing missing nodes" instead of generating. ComfyUI Manager solved the nodes half; this pack takes a swing at the models half. It's young, rough around the edges, and genuinely handy for the specific job.
How it works
You write a manifest with lora, embedding, and checkpoint arrays. Each entry needs a name and a modelVersionId - that's the number in the model version URL (civitai.com/models/<model>/<slug>?modelVersionId=97207), not the model's main id. Optional extras: a strength per LoRA, and positive / negative prompt strings that travel along for the ride.
{
"lora": [
{ "name": "A-Mecha_Musume_A_", "modelVersionId": "97207", "strength": "1.5" }
],
"checkpoint": [
{ "name": "WAI-REAL_CN", "modelVersionId": "655516" }
],
"positive": "solo, spine, translucent, transparent, scars,",
"negative": "score_6, score_5, score_4, pony,"
}
For every entry it resolves in the same order: local first (it looks for a file named {name}_{modelVersionId}.safetensors in the target folder), then R2 if you've enabled that cache, then CivitAI - hitting https://civitai.com/api/download/models/{modelVersionId} with your token appended if you gave one. Files land as {name}_{modelVersionId}.safetensors and existing files are skipped rather than re-downloaded. Every entry in the output JSON gets a local_path and a source (local / r2 / civitai / miss), so you can see exactly where each model came from.
The inputs that matter
- save_dir_lora / save_dir_checkpoint / save_dir_embedding - which subfolder of
ComfyUI/modelseach type goes into. They're dropdowns built from your actual models directory. - Json_Lora - the manifest, multiline.
- token_id - your CivitAI API token. Public models download fine without it, but some gated files and heavier rate limits want it.
- ignore and ignore_down_checkpoint - set these to skip downloading entirely for LoRAs/embeddings or for checkpoints respectively. Handy when you only want the LoRAs and already run a local base model.
The whole R2 cluster (enable_r2_cache, r2_endpoint, …), return_path_mode, and the backfill toggles are an optional Cloudflare R2 object-store cache for people syncing many machines. Ignore them unless you know why you need them.
Outputs: "Json Lora" (the enriched manifest - wire it into Kw_JsonLoraLoader), "checkpoint" (the first checkpoint's path), Positive, and… "Nagative". Yes, that's a real output name, misspelled in the source. That's the socket you'll see in your graph; wire it into your negative CLIPTextEncode and move on.
Install
ComfyUI Manager - search "comfyui-Lora-auto-downloader" - or the manual route:
cd ComfyUI/custom_nodes
git clone https://github.com/kycg/comfyui-Lora-auto-downloader
Then restart ComfyUI. It's light: the only real dependency is requests (os, json, re are stdlib). boto3 gets auto-installed if you flip on R2; auto_install_deps defaults to true so you'll see a pip install in the console on first run if something's missing.
Where people get burned
- The README says to "set your token and model id" - the code ignores
model_identirely. It's a leftover compat field. Token is optional, so if downloads work without one, don't sweat it. - Malformed JSON won't crash hard; the node logs the parse error and returns the raw string with empty paths. Watch the console.
- Checkpoints are multi-gigabyte. If you only want LoRAs, set
ignore_down_checkpointand keep your own base. - The whole thing keys on
modelVersionId. CivitAI removals are a real thing - the community has measured roughly 20% of older download links rotting. When a version id 404s, that entry just fails. - Don't rename downloaded files. The loader downstream will fuzzy-match, but the naming convention is the contract.
Inputs (21)
| Name | Type | Default | Description |
|---|---|---|---|
| save_dir_lora | COMBO | 26 options: model_patches, gligen, latent_upscale_models, vae, unet, clip_vision, +20 | |
| save_dir_checkpoint | COMBO | 26 options: model_patches, gligen, latent_upscale_models, vae, unet, clip_vision, +20 | |
| save_dir_embedding | COMBO | 26 options: model_patches, gligen, latent_upscale_models, vae, unet, clip_vision, +20 | |
| Json_Loraopt | STRING | — | |
| ignoreopt | BOOLEAN | false | — |
| ignore_down_checkpointopt | BOOLEAN | false | — |
| model_idopt | STRING | — | |
| token_idopt | STRING | — | |
| full_urlopt | STRING | — | |
| enable_r2_cacheopt | BOOLEAN | false | — |
| r2_endpointopt | STRING | — | |
| r2_bucketopt | STRING | — | |
| r2_access_keyopt | STRING | — | |
| r2_secret_keyopt | STRING | — | |
| r2_prefixopt | STRING | — | |
| r2_regionopt | STRING | — | |
| auto_install_depsopt | BOOLEAN | true | — |
| return_path_modeopt | COMBO | 3 options: name, relative, absolute | |
| r2_backfill_on_local_hitopt | BOOLEAN | true | — |
| r2_backfill_syncopt | BOOLEAN | false | — |
| r2_backfill_retriesopt | INT | 10–5 | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| Json Lora | STRING | — |
| checkpoint | STRING | — |
| Positive | STRING | — |
| Nagative | STRING | — |