Nodes/AUN ComfyUI Nodes/Extract Model Name
ComfyUI Node

Extract Model Name

Pull a model's name out of any loader node for your filenames

By loz2754·Created 8 months ago·Updated about 22 hours ago· 5
Extract Model Name
    • full_model_name
    • short/manual name
    node_id0
    manual_name
    use_manual_namefalse

    Some loaders are polite and give you the model name as an output socket. Most video loaders aren't - you drop in a UNet loader, a Diffusers loader, or a GGUF loader and the only thing coming out is MODEL and CLIP, with the name buried in a widget. AUNExtractModelName exists for exactly that gap: you tell it which node holds your model, it digs the name out of the graph, and it hands you a clean string you can drop into a filename.

    The one required input is node_id - the numeric ID of the loader node to inspect (or its title, if you'd rather refer to it by name; the node matches either). Since IDs aren't always visible, you can grab them from the node's context menu or the workflow JSON; titles are friendlier if you've bothered to name your loaders. The node scans that node's inputs for a model-like string value, which is how it finds "the model name" without you telling it which widget to look at.

    Two optional inputs refine the output. manual_name plus the use_manual_name boolean let you override the extracted name entirely - set use_manual_name on, type a friendly short name, and the short output becomes your string (sanitized, so it's safe as a filename even if you typed slashes or colons). Off, and you get the auto-shortened version.

    The outputs are the pair you'll actually use. full_model_name is always the real extracted basename - the actual file name, useful for logs, sidecars, or showing the user. short/manual name is the auto-shortened version, which is what the pack recommends for filenames because long GGUF names with their quant suffixes are ugly and can blow past Windows path limits. Auto-shortening uses the same helper the pack's filename nodes use, so your short output stays consistent with what AUNPathFilenameV2 would produce on its own.

    Under the hood it reads the workflow from extra_pnginfo and the prompt graph, so it works even in subgraphs (matching namespaced IDs like subgraph.node), and its IS_CHANGED hook forces a re-read every run so the name tracks whatever model is currently selected. That last part matters - swap the model widget and the extracted name follows without you touching the extractor.

    From the AUN pack: ComfyUI Manager (search "AUN") or cd ComfyUI/custom_nodes && git clone https://github.com/loz2754/AUN-ComfyUI-Nodes, then restart. No models, dependency-light. If you've been typing model names into your save node by hand and then wondering why the filenames lie after a swap, this is the fix.

    CategoryAUN Nodes/Utility

    Inputs (3)

    NameTypeDefaultDescription
    node_idSTRING0The numeric ID or Title of the model loader node to inspect.
    manual_nameoptSTRINGManual model name (optional). When 'use manual name' is on, this value (sanitized) becomes the short/manual output.
    use_manual_nameoptBOOLEANfalseWhen true and manual_name is not empty, outputs will use the manual name (sanitized).

    Outputs (2)

    NameTypeDescription
    full_model_nameSTRING
    short/manual nameSTRING