Model from Metadata
Drop the PNG, get the exact model back
- model
- clip
- vae
- metadata
- image
You've got an image - one you generated last week, one a friend sent you, one you grabbed off CivitAI - and you want to regenerate it, or just steal its exact checkpoint and VAE without spelunking through your models/checkpoints folder. That's the entire job of Model from Metadata. Drop the image on the node and it digs the model name out of the embedded metadata, matches it against what you have installed, and loads it. The name is accurate; the magic is mostly reading, not guessing.
This is the leanest of the four nodes in the Model and Prompt from Metadata pack. It loads the checkpoint and VAE, nothing else. If you also want the prompt that produced the image, its sibling Model-Prompt from Metadata (ImageMetadataPromptLoader) does all this plus the prompts in one node - reach for that one instead and save yourself a wire. This one is for when you want the model but plan to write your own prompt anyway.
How it works
ComfyUI has shipped workflows embedded in output PNGs for ages - it's one of the things that made the "workflow included" sharing culture possible. This node exploits exactly that. Drag a PNG or WebP onto the node's drop zone and its JavaScript parses the metadata in your browser (prompt chunk for PNG, EXIF for WebP), extracts the checkpoint and VAE names, and compares them against your installed files. Matching is fuzzy: case-insensitive, falls back to filename, then to basename-without-extension. Each detected name gets a badge - green ✓ if that exact file is installed, red ✗ if it isn't. If exactly one checkpoint is detected and installed, it's auto-selected; the same for the VAE. If you don't have the model, you get a ✗ and a dropdown full of what you do have, which is honest but slightly sad.
The dropped image itself gets uploaded to ComfyUI's input folder and comes out the image output as an IMAGE tensor - handy if you want to feed it straight into img2img or an IPAdapter as a reference.
Inputs and outputs that matter
Only two inputs are yours to worry about; the rest are bookkeeping:
ckpt_name- the checkpoint. Auto-selected when a match is found; pick manually otherwise.vae_name- set toNoneto use the VAE baked into the checkpoint (which is usually what you want), or pick a standalone VAE.
(_metadata_json and _image_file are internal state, not knobs for you to touch.) Outputs are model, clip, vae - wire them into your KSampler and CLIP encoder as you would from any checkpoint loader - plus metadata (the raw parsed JSON) and image.
Installing it
Same story for all four nodes in the pack, so this applies pack-wide. Easiest route: ComfyUI Manager → Install Custom Nodes → search "Model and Prompt from Metadata". Or, from the command line:
cd ComfyUI/custom_nodes
git clone https://github.com/ketle-man/model-and-prompt-from-metadata
Then restart ComfyUI. Good news on the heavy-lifting front: there is none. The pack's Python dependency list is empty - it only uses what ComfyUI already ships (PIL, numpy, torch, comfy.sd). No model files to download, nothing to pip install.
Gotchas
The big one, straight from the README: UNet-based models - Flux, Qwen, Z-Image - are out of scope. This node only understands checkpoint-based SD1.5 / SDXL / Illustrious lineage. Drop a Flux workflow on it and it'll dutifully display the detected names, then shrug; the author points you to his companion pack, Workflow Studio, for those. Also worth knowing: the drop zone caps files at 50 MB, and it's not picky about source - PNGs from SD WebUI, Forge, and Fooocus carry their parameters in the parameters chunk and parse fine too. If nothing auto-selects, check the ✓/✗ badges first; "the metadata says one thing, my folder has another" is the #1 way this node confuses people.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| ckpt_name | COMBO | Checkpoint model to load. Drop a ComfyUI PNG/JSON above to auto-select. | |
| vae_name | COMBO | VAE to use. Select 'None' to use the VAE embedded in the checkpoint. | |
| _metadata_json | STRING | — | |
| _image_file | STRING | — |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| model | MODEL | — |
| clip | CLIP | — |
| vae | VAE | — |
| metadata | METADATA | — |
| image | IMAGE | — |