Nodes/ComfyUI-Lora-Manager/Load Image Metadata (LoraManager)
ComfyUI Node

Load Image Metadata (LoraManager)

That PNG You Saved Six Months Ago Is Also a Settings File

By willmiao·Created 2 years ago·Updated about 11 hours ago· 1,516
Load Image Metadata (LoraManager)
    • image
    • mask
    • positive
    • negative
    • model_name
    • lora_stack
    • lora_stack_text
    • seed
    • steps
    • cfg
    • sampler_name
    • scheduler
    • width
    • height
    • denoise
    • report
    • readable_report
    • missing_files
    ◄image▾►
    ◄sampler_node_id►
    ◄missing_settings▾►
    ◄overrides_json{}►
    ◄prefer_saved_image_metadatatrue►

    Every PNG ComfyUI writes carries the graph that made it. You know this, vaguely - you've dragged an image onto the canvas and watched the workflow rebuild. Load Image Metadata (LoraManager) is the other half of that trick: instead of rebuilding the graph, it digs the values out and hands them back as wires. Prompt, negative, seed, steps, cfg, sampler, scheduler, size, denoise, checkpoint name, and the LoRA stack with strengths.

    Why you'd reach for it: you have a folder of generations you liked, or someone posted a PNG you want to riff on, and you'd rather not retype twelve numbers off a metadata viewer.

    How it actually works

    It's a metadata reader plus a catalog lookup, not a magic re-run. It reads the A1111-style parameters text chunk, the ComfyUI prompt chunk (API graph), the workflow chunk (UI graph), and EXIF UserComment - plus the two spots ComfyUI hides WebP metadata in EXIF Make/Model, and a brotli path for AVIF/JXL, which is why the pack depends on brotli at all.

    prefer_saved_image_metadata defaults to true: if there's an A1111-style parameters block, it parses that flat string and stops - and while it's doing that, sampler_node_id is ignored entirely (the source says so in a note). Turn it off and it goes after the embedded ComfyUI graph instead, picking an active sampler; muted and bypassed ones are skipped.

    Then the interesting bit: extracted model and LoRA names get matched against your local LoRA Manager catalog. Exact path first, then filename, then stem, then catalog alias - in that order, never fuzzily. Ambiguity is a hard error, not a coin flip. Anything it can't find lands in a separate missing_files output and gets dropped from the stack rather than silently stacking a LoRA you don't own.

    One honesty note from the author's own report text: metadata does not restore your VAE, text encoders, ControlNet, regional conditioning, or the original latent pipeline. Prompts, a model name, LoRAs, sampler settings. The rest is on you.

    The inputs and outputs that matter

    Five inputs, and you'll touch three. image comes from your ComfyUI input folder. sampler_node_id is the one beginners miss - leave it empty for a single-sampler workflow, but a two-stage graph (Wan 2.2 high/low noise, say) needs the node id, and inside a subgraph that's the full API id like 1481:1783. overrides_json is the escape hatch: {"scheduler":"normal", "model_name":"folder/model.safetensors"}, or "loras": [] to wipe the recovered stack. Only the sampler fields, model/width/height and loras are allowed there; unknown keys raise rather than being quietly ignored.

    missing_settings offers use_defaults and strict. Before you trust it: in the shipped code both paths return defaults with an ERROR line in the report, so strict doesn't hard-fail.

    Eighteen outputs sounds alarming and mostly isn't. The ones you wire: image and mask onward into whatever consumes them, positive and negative into your text encoders, lora_stack into the Lora Loader (LoraManager), and seed/steps/cfg/sampler_name/scheduler/width/height/denoise into your sampler and latent nodes - after right-clicking those widgets and choosing Convert widget to input. That conversion is the whole point of the node. readable_report is the one you read when something's off; report is the machine-ish version.

    Installing it

    This is the LoRA Manager pack, so you get the manager whether or not you wanted it - which is fine, since the node's model resolution is the manager's catalog.

    In ComfyUI Manager, search lora-manager, install, restart. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/willmiao/ComfyUI-Lora-Manager.git
    cd ComfyUI-Lora-Manager
    pip install -r requirements.txt
    

    The dependencies are light - aiohttp, Pillow, safetensors, piexif, numpy, natsort, GitPython, aiosqlite, PyYAML, brotli. No torch, no onnx, nothing compiled. First launch indexes your model folders, which takes a while on a big library, and the UI lives at http://localhost:8188/loras. The CivitAI API key it asks for is only for downloading from CivitAI; scanning and metadata lookup work without it.

    Where people get burned

    You get an SDXL bottle prompt and the word ERROR. That's the no-metadata path: a synthetic "glass bottle" starter preset, with the report saying plainly those settings were not extracted from your image. Usually the file got re-encoded - Reddit re-serves uploads, Discord inline previews, anything converting to lossy WebP or JPEG drops PNG text chunks, and a screenshot never had them. If you only have the stripped copy, find the original; CivitAI keeps uploads and parses their generation data. Keep your own master PNGs.

    The LoRA names look right but nothing loaded. Extraction worked and resolution failed: either the file isn't indexed in the manager yet, or two LoRAs share a filename in different folders, which trips the ambiguity error. Fix the latter with a relative path in overrides_json. missing_files names them more clearly than the notes block does.

    Wrong sampler's settings from a two-stage workflow. Set sampler_node_id - composite id if it's in a subgraph.

    You double-applied a LoRA. The loader takes the stack and whatever's in its own widget. Keep stack order, don't add them again in the loader.

    One more: this pack moves fast and has had stretches where the LoRA side broke on an update - trigger words failing, loaders erroring until people moved to a nightly. If catalog lookups stop resolving after an update, check the pack version before rebuilding your workflow.

    CategoryLora Manager/loaders

    Inputs (5)

    NameTypeDefaultDescription
    imageCOMBO1 options: example.png
    sampler_node_idSTRINGLeave empty for a single sampler. Subgraphs: use the full API ID, e.g. 1481:1783 (or 1481/1783). A container or leaf ID works only when unique.
    missing_settingsCOMBOExtraction errors always return defaults and an ERROR report, including for saved strict settings. Unresolved files are listed in missing_files.
    overrides_jsonSTRING{}Explicit replacements, e.g. {"scheduler":"normal", "model_name":"folder/model.safetensors"}. Use "loras": [] to clear the recovered stack.
    prefer_saved_image_metadataBOOLEANtruePrefer saved A1111-style generation parameters. Disable to select an active workflow sampler; muted/bypassed samplers are excluded.

    Outputs (18)

    NameTypeDescription
    imageIMAGE—
    maskMASK—
    positiveSTRING—
    negativeSTRING—
    model_name*—
    lora_stackLORA_STACK—
    lora_stack_textSTRING—
    seedINT—
    stepsINT—
    cfgFLOAT—
    sampler_name*—
    scheduler*—
    widthINT—
    heightINT—
    denoiseFLOAT—
    reportSTRING—
    readable_reportSTRING—
    missing_filesSTRING—