Nodes/LoRA Optimizer/LoRA Metadata Reader
ComfyUI Node

LoRA Metadata Reader

See what's actually baked into a LoRA file

By ethanfel·Created 5 months ago·Updated 23 days ago· 135
LoRA Metadata Reader
  • lora_stack
  • lora_stack
  • prompt
  • description
  • metadata_info

A LoRA .safetensors file isn't just tensors - trainers routinely embed a metadata block alongside the weights: training prompt, description, sometimes merge lineage if the file was produced by a merge tool rather than trained from scratch. Most of the time nobody looks at it, because most loaders don't expose it. This node does one job: pull that metadata out and put it somewhere you can read it.

Why you'd reach for it

Two real situations. First, you downloaded a LoRA from CivitAI or a community share and the page description is thin or gone - the file itself often still carries the trigger word or prompt the author trained it with, embedded at save time. Second, you're debugging a merge: if a LoRA in your stack came out of this same pack's Save Merged LoRA node, its metadata records what it was merged from and with what settings, which is genuinely useful when you're trying to figure out six months later what merged_style_v3.safetensors actually contains.

It works on any .safetensors LoRA, not just ones this pack produced - it's a generic reader, not a proprietary format.

How it works

It's a passthrough node: connect a lora_stack, it reads the embedded metadata off every LoRA in that stack, and passes the stack through completely unchanged. Nothing about your merge is affected by using this node - it's purely for inspection, which means you can drop it anywhere in a graph without worrying about side effects.

The inputs and outputs that matter

  • lora_stack (required) - connect a LoRA Stack or LoRA Stack (Dynamic) node here. The stack passes through unchanged on the other side.

Outputs, all read-only strings:

  • lora_stack - identical to what came in. Chain it onward to LoRA Optimizer or wherever you were already headed.
  • prompt - the training prompt embedded in the file, if the trainer saved one.
  • description - a free-text description field, if present.
  • metadata_info - the consolidated dump: source_loras, merge_mode, merge settings, and whatever else was written into the file.

Wire any of the three string outputs to a Show Text node to actually read them - on their own they're just strings sitting in the graph.

How to install it

ComfyUI Manager: search "LoRA Optimizer", install, restart. Manually:

cd ComfyUI/custom_nodes/
git clone https://github.com/ethanfel/ComfyUI-LoRA-Optimizer.git

Restart - it shows up under loaders. No downloads needed; it reads files you already have.

Common issues & troubleshooting

All three outputs come back empty. Not every LoRA carries this metadata - plenty of trainers don't write a prompt or description into the file at all, and older or hand-edited LoRAs are especially likely to be blank. An empty output here means the file genuinely has nothing to report, not that the node failed.

You only want metadata for one LoRA in a big stack. The node reads every LoRA in the stack it's given and returns a consolidated result, not a per-LoRA breakdown. If you need to inspect a single file in isolation, feed it a stack containing just that one LoRA rather than your full production stack.

Trigger words aren't showing up. Trigger words are usually convention (a token the trainer tells you to include in your prompt) rather than something universally embedded as structured metadata - if a LoRA's page or README lists a trigger word but this node's prompt/description outputs don't mention it, that's the file's own trainer not having saved it, not a bug in the reader.

CategoryLoRA Optimizer

Inputs (1)

NameTypeDefaultDescription
lora_stackLORA_STACKConnect a LoRA Stack here. The stack passes through unchanged.

Outputs (4)

NameTypeDescription
lora_stackLORA_STACK
promptSTRING
descriptionSTRING
metadata_infoSTRING