Nodes/ComfyUI-SKLoRA-Manager/SK Lora Meta Extractor
ComfyUI Node

SK Lora Meta Extractor

Read a PNG's generation recipe, and get a clean copy

By sinvks·Created 8 months ago·Updated 3 months ago· 13
SK Lora Meta Extractor
    • info_json
    • clean_image
    • workflow_raw
    • prompt_raw
    ◄image▾►
    â—„optimize_outputtrueâ–º
    â—„compress_level4â–º

    Every PNG that comes out of ComfyUI is a portable project file: the workflow that made it lives inside the image as embedded text chunks, and the model's own SaveImage writes the whole graph there. This node is the tool that cracks that payload open - it reads the metadata out of an image and returns it as structured JSON, and as a bonus hands you a copy of the image with that metadata stripped.

    The pairing makes sense for the pack's home turf (recovering LoRA recipes). Drop in a generation you like, and you get its base model, sampler settings, seed, positive/negative prompts, and - the thing the pack cares about - the list of LoRAs it used, matched against what's actually sitting in your models/loras folder with local paths resolved.

    How it works. It reads the PNG/WebP info chunks directly: workflow (the UI graph) and prompt (the API format), plus the A1111-style parameters string. If it finds ComfyUI API JSON, it walks the nodes - pulling the base model from CheckpointLoaderSimple/UNETLoader, sampler parameters from KSampler, and LoRAs from LoraLoader, LoraLoaderModelOnly, and this pack's own SK_LoraLoaderManager. For A1111 files it falls back to parsing the flat Negative prompt: / Steps: string. The result is one info_json with everything bucketed: base model, seed, parameters, prompts, LoRAs, image size, and the raw metadata for the cases it couldn't neatly parse.

    Inputs that matter. image is an upload from your input folder. optimize_output (default on) re-saves the image as a PNG with compression - which is exactly what removes the metadata, because re-encoding drops the text chunks. compress_level (0–9, default 4) trades file size against re-encode quality when that's enabled.

    Outputs. info_json (STRING) is the full parse - an output node, so it also prints the JSON in the UI. clean_image is the stripped, recompressed image, ready for sharing without giving away your workflow (handy if you post to hosts that recompress anyway). workflow_raw and prompt_raw are the untouched metadata strings, for when you want the source rather than the interpretation.

    Honest limits. The positive/negative prompt split is a heuristic - it flags text as negative if it contains "bad" or "negative", so a prompt that legitimately contains those words gets mis-bucketed. Base-model and sampler extraction only reach as far as the node classes it knows. And if the source image went through Reddit, a thumbnail CDN, or any host that re-encodes, the metadata is already gone - this node can't resurrect what was stripped before it got to you. Check info_json for "No metadata found" and you'll know that's what happened.

    Installing. ComfyUI Manager (search "SK LoRA Manager") or:

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

    Restart and you're done - no model downloads. The real dependency is on the source file being an untouched original: feed it the PNG straight off your output/ folder, not a screenshot.

    Category🪄 SK LoRA Manager

    Inputs (3)

    NameTypeDefaultDescription
    imageCOMBO1 options: example.png
    optimize_outputBOOLEANtrue—
    compress_levelINT40–9—

    Outputs (4)

    NameTypeDescription
    info_jsonSTRING—
    clean_imageIMAGE—
    workflow_rawSTRING—
    prompt_rawSTRING—