Nodes/Mango Node Pack/Trigger Exporter (Mango)
ComfyUI Node

Trigger Exporter (Mango)

The node that started this whole pack

By mang01010·Created about a year ago·Updated 4 months ago· 3
Trigger Exporter (Mango)
  • lora_stack
  • STRING

The pack README is explicit: this is where Mango Node Pack started. Trigger Exporter (Mango) reads a lora_stack - the list of LoRAs your loader applied - and returns every LoRA's trigger words as one comma-separated string. The pitch is dead simple: stop forgetting the magic token that activates a character or style LoRA. Wire the output into your prompt and the triggers are always present, automatically.

For anyone who's ever generated a "characterless" image because they forgot ch9ractername in the prompt, this node is genuinely the pack's most useful idea. Trigger words are baked into most trained LoRAs (the trainedWords metadata field on Civitai, or the modelspec.trigger_phrase convention), and this node's whole job is to extract them without you touching a browser.

How it works

For each LoRA in the stack, the node runs a three-step lookup. First it checks a local cache (lora_metadata_db.json in the pack folder) so it doesn't repeat work. Then it opens the LoRA file itself with safetensors and reads its embedded metadata - looking for trainedWords (handling both comma-separated strings and lists) and modelspec.trigger_phrase. If the file has no trigger words embedded, it falls back to computing the file's SHA-256 hash and querying the Civitai API's model-versions/by-hash endpoint to fetch the triggers from the site. Results are cached locally so the Civitai round-trip happens once. Finally, every found trigger is joined with , into a single STRING.

That fallback chain matters: local metadata is instant and offline-friendly, but many LoRAs don't embed triggers, which is why the Civitai API lookup exists.

Inputs and outputs

  • lora_stack - the only input. Wire it from Loader (Mango), LoRA Stack (Mango), or any Mango loader that produces a stack. The node reads the stack to know which LoRAs to inspect.
  • STRING - the output: all trigger words, comma-separated. Feed it into the Prompt (Mango) node's optional string input, or splice it into a prompt text field.

Installing it

Trigger Exporter (Mango) ships with the Mango Node Pack:

cd ComfyUI/custom_nodes
git clone https://github.com/mang01010/MangoNodePack

Restart ComfyUI, or install "Mango Node Pack" from ComfyUI Manager. This is one node where the README's dependency warning is real: the pack lists pip install safetensors as required, because the local-metadata read depends on it (stock ComfyUI already ships it). The Civitai fallback uses requests, which ComfyUI also bundles.

Gotchas

A few honest caveats. The Civitai hash lookup only works when the hash is actually recognized - the README's known issue is that occasionally a LoRA won't be found because the model was updated on Civitai, so re-downloading the file fixes it. If the file has no embedded triggers and the API call fails, you get nothing - no fake trigger invented, just empty output, so the node fails safe but silent. There's also a subtle behavior worth knowing: only LoRAs in the stack are queried, and the stack only contains LoRAs your loader actually applied, so a LoRA you selected but set to None won't be included. If a character LoRA's trigger isn't showing up, double-check it's actually active in the stack, not just in the loader dropdown.

CategoryMango Node Pack/Metadata

Inputs (1)

NameTypeDefaultDescription
lora_stackLORA_STACK

Outputs (1)

NameTypeDescription
STRINGSTRING