Nodes/AAA Metadata System/Eric Civitai Prompt Extractor + Auto LoRA Loader
ComfyUI Node

Eric Civitai Prompt Extractor + Auto LoRA Loader

Load the image, get back the model and LoRAs that made it

By EricRollei·Created 10 months ago·Updated 8 months ago· 13
Eric Civitai Prompt Extractor + Auto LoRA Loader
  • model
  • clip
  • model
  • clip
  • image
  • mask
  • filename
  • full_path
  • positive_prompt
  • negative_prompt
  • sampler
  • cfg
  • seed
  • clip_skip
  • resources
  • raw_exif
  • file_count
  • current_index
  • status
image
use_folderfalse
folder_path
folder_index0
auto_incrementfalse
write_txtfalse
txt_directory
exiftool_path
max_loras4
use_primary_onlytrue
use_resource_weightstrue
default_strength0.75
default_clip_strength1.00
query_civitaitrue
refresh_lora_indexfalse

The plain Civitai extractor hands you the recipe. This one cooks it. Eric Civitai Prompt Extractor + Auto LoRA Loader reads the prompt and LoRA list out of an image like its sibling, then actually applies those LoRAs to the model and CLIP you feed in - so a gallery image can walk into your workflow and come back as a fully loaded, reproduction-ready setup. That's the whole trick: reconstruction without retyping.

It's from the AAA Metadata System pack, and it's the extractor family's showpiece. The honest catch: it can only auto-load the LoRAs you actually have locally. The resources list in the metadata names them, and the node matches those names against your installed LoRAs. If a LoRA isn't in your collection, it gets skipped (and status tells you what happened). So this is at its best when you've downloaded the exact set that made the image.

How it works

Same extraction as the base node - reads the EXIF UserComment via ExifTool, parses the recipe. Then the extra step: it decodes the resources list, matches each named LoRA to a file in your LoRA folders, and applies them to your model and clip inputs in order, honoring the recorded weights when use_resource_weights is on or falling back to default_strength (0.75) and default_clip_strength (1.0). max_loras (default 4) caps how many get applied - a busy workflow may reference a dozen.

When a LoRA isn't found locally, it can do a clever fallback: with query_civitai on, it queries the Civitai API to identify the resource and try to resolve it. There's a local cache (civitai_cache.json) so repeat lookups are fast, and refresh_lora_index forces a rescan of your LoRA folders. Every action gets logged into the status output - applied X, skipped Y (not found) - which is the single most useful string in this node.

Inputs and outputs that matter

  • model and clip - required inputs; these get the LoRAs applied. Wire from your checkpoint loader.
  • Everything the base extractor takes (image, use_folder, folder_path, exiftool_path, etc.).
  • max_loras - how many LoRAs to apply (0–16).
  • use_primary_only - apply just the primary LoRA and skip the rest.
  • use_resource_weights - honor the strengths recorded in the metadata vs. use defaults.
  • query_civitai - allow API lookups for missing LoRAs (network traffic, default on).
  • refresh_lora_index - rebuild the local LoRA index.

Outputs: model and clip (now LoRA-stacked), everything the base extractor outputs (prompt, negative, sampler, cfg, seed, clip_skip, resources, raw_exif, image, mask, filenames and counts), plus a status string summarizing the loads and skips.

Installing it

Part of AAA Metadata System by Eric Hiss (GitHub: EricRollei). Via ComfyUI Manager (search "AAA Metadata System") or:

cd ComfyUI/custom_nodes
git clone https://github.com/EricRollei/AAA_Metadata_System.git
cd AAA_Metadata_System
pip install -r requirements.txt

And install ExifTool (exiftool.org, or your package manager) - this node's extraction depends on it, same as the base extractor. Restart ComfyUI.

Common issues

Expect some LoRAs to be skipped; that's normal when you don't own the exact set, and status will say so - read it before assuming the result is wrong. If extraction returns empty, ExifTool is the first suspect (see the base extractor's notes). Weights rarely reproduce exactly: the recorded strength is what the author used on their setup, and default_strength is a guess for anything unrecorded, so treat the output as a starting point, not a forensic copy. And query_civitai means real network calls on first runs with new LoRAs - if it's slow, that's the API round-trip, not a hang. When it works, it's the closest thing to drag-the-image-in-and-reproduce.

Categorymetadata

Inputs (17)

NameTypeDefaultDescription
modelMODEL
clipCLIP
imageCOMBO1 options: example.png
use_folderBOOLEANfalse
folder_pathSTRING
folder_indexINT00–10000000
auto_incrementBOOLEANfalse
write_txtBOOLEANfalse
txt_directorySTRING
exiftool_pathSTRING
max_lorasoptINT40–16
use_primary_onlyoptBOOLEANtrue
use_resource_weightsoptBOOLEANtrue
default_strengthoptFLOAT0.750–5
default_clip_strengthoptFLOAT1.00-10–10
query_civitaioptBOOLEANtrue
refresh_lora_indexoptBOOLEANfalse

Outputs (17)

NameTypeDescription
modelMODEL
clipCLIP
imageIMAGE
maskMASK
filenameSTRING
full_pathSTRING
positive_promptSTRING
negative_promptSTRING
samplerSTRING
cfgFLOAT
seedINT
clip_skipINT
resourcesSTRING
raw_exifSTRING
file_countINT
current_indexINT
statusSTRING