Nodes/Santodan Random LoRA Node/Extract And Apply LoRAs
ComfyUI Node

Extract And Apply LoRAs

Lift the LoRAs out of an old image and reuse them

By Santodan·Created about a year ago·Updated 2 months ago· 28
Extract And Apply LoRAs
  • model
  • clip
  • MODEL
  • CLIP
  • LORA_INFO
image_path./input/example.png

This node exists for a very specific and very real workflow: you generated an image you like, its metadata contains <lora:name:weight> tags, and you want to run an enhancement pass using the exact same LoRAs and weights without manually re-entering any of them. The author built it for exactly that - "try to generate a better enhancement workflow but with the same loras and weight as the initial one." Point it at an image file, and it reads the metadata, finds the LoRA tags, and applies them to your model and clip.

It's a metadata extractor plus a stock LoraLoader in one node.

How it works

Open the image, read the parameters chunk of its PNG metadata (the A1111-style string), and regex out every <lora:NAME:WEIGHT> tag. Then it normalizes each NAME the way the metadata extension wrote it - lowercase, spaces/dots/dashes to underscores - and matches it against the actual files in your models/loras tree. Every match gets loaded through ComfyUI's built-in LoraLoader at the recorded weight, applied to your model and clip, and logged.

Three outcomes per tag: applied, (NOT FOUND) if the file isn't in your loras folder, or an error message if the load itself failed. That logging goes to the LORA_INFO string output, so you can see exactly what the node did.

Inputs / outputs

  • image_path (required) - path to the image whose metadata you want, default ./input/example.png.
  • model / clip (required) - the pipeline the LoRAs get applied to.
  • Outputs: MODEL, CLIP, and LORA_INFO (the per-LoRA result log).

What it won't do

  • It only reads A1111-style <lora:...> tags. No CivitAI sha256 lookup, no trigger words, no lora_stack output - it's purely extract-and-apply. If your metadata doesn't carry the tags, the output is a "No LoRAs found" message and your model passes through unchanged.
  • It needs the files locally. A tag for a LoRA you deleted or never downloaded resolves to (NOT FOUND). No magic downloads.
  • The match is fuzzy on purpose. Because names get normalized, a tag like my-style-v2 can match my_style_v2.safetensors. That's a feature when metadata comes from a different convention, and a trap when you have near-identical files - check the LORA_INFO log if the wrong LoRA seems to load.

The workflow it's meant for

The author's recommendation: load several images at once with the SDBatchLoader node from receyuki's comfyui-prompt-reader pack, and feed its path output here. That turns "enhance a batch of old gens" into a loop: same base model, same LoRAs, same weights, new post-processing. You'd pair it with a metadata-saver (like this pack's LoraMetadataHub + the metadata extension) so the enhanced output carries the same tags forward.

Install

ComfyUI Manager (search "Santodan"), or:

cd ComfyUI/custom_nodes
git clone https://github.com/Santodan/santodan-custom-nodes-comfyui

Restart. No dependencies, no downloads - it reads your existing loras folder and your images' metadata.

CategorySantodan/LoRA

Inputs (3)

NameTypeDefaultDescription
image_pathSTRING./input/example.png
modelMODEL
clipCLIP

Outputs (3)

NameTypeDescription
MODELMODEL
CLIPCLIP
LORA_INFOSTRING