Civitai Prompt Stats (LORA)
Stop guessing your LoRA's trigger words — let Civitai count them for you
- positive_prompt
- negative_prompt
- metadata_triggers
- civitai_triggers
"Trigger word not working" is on the standard LoRA troubleshooting checklist, right next to base-model mismatch and weight too high. This node attacks exactly that problem. Civitai Prompt Stats (LORA) takes a LoRA you've already downloaded, finds it on Civitai, and comes back with two things: a ranked census of the prompts the community actually generates with it, and the trigger words from two independent sources. It's an answer machine, not a generation node - drop it in, hit run, read the output, then delete it from the graph.
Here's the mechanism, because it explains everything about where this node works and where it won't. It hashes your local file (SHA-256), looks the hash up against Civitai's by-hash API to get the model version ID, then pulls up to max_pages of images that used that version (100 per page), parses every prompt and negative prompt, and tallies each tag. The parsing splits on commas and weight brackets, so a prompt like masterpiece, best quality, 1girl becomes three separate counts. That means the outputs are ranked lists of individual tags with counts - 0 : "1girl" (342) - not copy-paste-ready full prompts. Expect the generic quality spam (best quality, 8k) to own the top of the list; the interesting signal is what shows up underneath it. Wire each output into a Show Text node to read it.
The LORA node's real special sauce is the two trigger-word outputs the CKPT sibling doesn't have:
metadata_triggers- readsss_tag_frequencyout of the safetensors file's header. That's the raw tag list the trainer captioned with, ranked by how often each tag appeared. Only exists if the file was trained with a Kohya-style pipeline that writes it; otherwise the output says so.civitai_triggers- the model author's explicittrainedWordsfrom the Civitai API, cached in thedatafolder after the first fetch.
Cross-reference them. When the training tags and the author's recommended words agree, you're looking at the real trigger. When they don't - and they often don't, because the metadata list contains every caption tag, not just the rare-token trigger - the author's trainedWords is usually the safer bet. As the broader LoRA advice goes, the effective trigger is a rare token that doesn't collide with ordinary vocabulary; the frequency list won't tell you that on its own.
The inputs are the same handful on both nodes in this pack. file_name is a dropdown auto-populated from your loras folder - no typing paths. top_n (default 20, up to 200) sets how many ranked entries each output emits. max_pages (default 3) sets how many 100-image pages to scan - bumping it gives you a wider census at the cost of more API calls. sort flips between Most Reactions (default), Most Comments, and Newest, which is a genuinely useful lever: "Most Reactions" shows you what got upvoted, "Newest" shows you what people do today. timeout and retries are self-explanatory, and force_refresh = yes blows away the caches so a re-run actually hits Civitai.
Install is as easy as it gets in this ecosystem: search "Civitai Prompt Stats" in ComfyUI Manager, or cd ComfyUI/custom_nodes && git clone https://github.com/BAIKEMARK/ComfyUI_Civitai_Prompt_Stats, then restart. The pack declares no dependencies at all - it only uses requests, which ComfyUI ships - and downloads no models. The trigger-word code is a remix of idrirap's ComfyUI-Lora-Auto-Trigger-Words logic with LoadLoraWithTags' ideas, which is a respectable provenance for a niche utility.
Where people get burned: if the model was never uploaded to Civitai - or its exact bytes aren't in the catalog - the hash lookup fails and you get empty strings, which reads as a bug but isn't. And remember the cache is aggressive: results that look wrong are often just yesterday's data, and force_refresh is the fix.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| file_name | COMBO | 1 options: | |
| top_n | INT | 201–200 | — |
| max_pages | INT | 31–50 | — |
| sort | COMBO | Most Reactions | 3 options: Most Reactions, Most Comments, Newest |
| timeout | INT | 101–60 | — |
| retries | INT | 20–5 | — |
| force_refresh | COMBO | no | 2 options: no, yes |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| positive_prompt | STRING | — |
| negative_prompt | STRING | — |
| metadata_triggers | STRING | — |
| civitai_triggers | STRING | — |