模型名称提取器 (Model Name Extractor)
Pull the checkpoint filename back out of a MODEL, for Save Image Plus
- model
- model_name
Small, single-purpose, and exactly as useful as it sounds. ComfyUI doesn't give you a built-in way to ask "what checkpoint file did this MODEL actually come from" once it's loaded and flowing through your graph - the filename lives in the loader's dropdown widget, not on the MODEL object in any form downstream nodes can read easily. This node exists to close that specific gap.
What it does
You wire your MODEL through it - required input model, whose own tooltip is candid that it's there "to maintain workflow connectivity," meaning this node sits inline in your model path rather than branching off to the side - and it outputs model_name, a plain string like myModel.safetensors. The node's own description spells out the intended use directly: extract the base model's name from the workflow, to use together with Save Image Plus for saving metadata.
That pairing is exact and deliberate. Save Image Plus has an optional checkpoint_name field for embedding the model name into A1111-format PNG metadata, but it's a manual string field - nothing forces it to match what you actually loaded, and it's easy to let it drift out of sync if you swap checkpoints and forget to update it. Wire Model Name Extractor's model_name output straight into that field instead, and the saved metadata always reflects the model that was actually used, with zero retyping and zero chance of drift.
The inputs and outputs that matter
model(required, MODEL) - pass your model through this node inline; it flows through unmodified in spirit, this node just reads its name off it. (Note: the declared output is the extracted string only - if your graph needs the MODEL object itself to continue downstream, keep the original wire running in parallel to wherever the model is actually consumed, and use this node purely for the string.)model_name(output, STRING) - per its own tooltip, the model's filename, e.g.myModel.safetensors, meant to feed Save Image Plus'scheckpoint_nameinput directly.
How to install it
ComfyUI Manager: search "ComfyUI-Danbooru-Gallery", install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/Aaalice233/ComfyUI-Danbooru-Gallery.git
cd ComfyUI-Danbooru-Gallery
pip install -r requirements.txt
Restart ComfyUI. No models or heavy dependencies - it reads metadata off a model you've already loaded, it doesn't load anything itself.
Common issues & troubleshooting
Output looks wrong or generic instead of your actual filename. Since this node reads the name off whatever loader produced the MODEL, confirm the model actually came from a standard checkpoint loader (this pack's own Simple Checkpoint Loader with Name, or ComfyUI's built-in Load Checkpoint) rather than a merge, a patch, or some other node that constructs a MODEL object without preserving a clean source filename - extraction depends on that name being attached to the object in the first place.
Save Image Plus's saved metadata still shows the wrong model. Double check the wire actually runs model_name → checkpoint_name and that nothing else is also feeding (or overriding) that same field - checkpoint_name on Save Image Plus is documented as highest-priority, so if something else is also wired there, that's what wins.
Node doesn't show up in the menu. Standard pack-load check: confirm the repo path, confirm dependencies installed, check the ComfyUI console at startup for an import error.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | 输入模型(用于保持工作流连接性) |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| model_name | STRING | 模型名称(例如:myModel.safetensors),可传递给 Save Image Plus 的 checkpoint_name 输入 |