Nodes/ComfyUI Civitai MCP/Civitai Get Model Metadata
ComfyUI Node

Civitai Get Model Metadata

Get trigger words, base model, AIR URN and download URL for any Civitai model version

By daceheg·Created 3 months ago·Updated 3 months ago· 6
Civitai Get Model Metadata
    • model_id
    • model_name
    • version_name
    • base_model
    • trigger_words
    • air_urn
    • download_url
    model_version_id0

    Every Civitai model page is stuffed with details you want in the middle of a workflow but never want to copy-paste from a browser tab: the trigger words you need to put in your prompt, what base model the thing was trained on, the direct download link, and the machine-readable AIR URN that identifies it. This node fetches all of it for a given model version ID and hands it back as typed outputs.

    The one input

    model_version_id (INT, required) - and this is the classic gotcha, because it is not the model ID. The number in a Civitai URL like civitai.com/models/123456 is the model ID (the parent, which can have many versions). You want the version ID - usually the ?modelVersionId=... query parameter on that URL, or whatever the Versions tab shows when you expand a specific release. Feed it a model ID and you'll get empty results back, which is the most common "why is this broken" report for this node.

    What comes out

    • model_id (INT) - the parent model's ID.
    • model_name (STRING) - the parent model's name.
    • version_name (STRING) - this specific version's name (e.g. "v2").
    • base_model (STRING) - what it was trained on, like SDXL 1.0, Flux.1 Dev, Pony, Illustrious. This is the field that tells you whether a LoRA will even load with your checkpoint.
    • trigger_words (STRING) - the trained/trigger words, comma-joined from Civitai's list. Drop these into your prompt to activate the LoRA.
    • air_urn (STRING) - the Civitai AIR URN for this version, the canonical identifier used in Civitai resources metadata. If you're building metadata by hand, this is what you want rather than a fragile numeric ID.
    • download_url (STRING) - direct file download link, handy for scripting model pulls.

    How it works

    One call to Civitai's public REST endpoint /api/v1/model-versions/{id}. It's public, so no API key needed. The node pulls modelId, name, baseModel, trainedWords, air and downloadUrl out of the response and does the list→string join on the trigger words.

    Where you'd actually use it

    The natural pair is Civitai Get Image Metadata: that node returns model_version_ids for the models that made an image, so you can pipe one of those IDs here and learn which LoRA, which checkpoint, and what trigger words - the complete "how was this made" chain, without ever opening a browser. It's also the obvious partner for Civitai Post Image's model_version_id input when you want a post linked to the right model. And if you're building a model-index or auto-downloader, download_url plus air_urn give you everything a script needs.

    One caveat: trigger words only exist for models trained with them - checkpoints and many LoRAs have none, so you'll get an empty string, which is correct, not a bug.

    Installing it

    ComfyUI Manager, search ComfyUI Civitai MCP, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/daceheg/ComfyUI-civitai-mcp.git
    

    Restart ComfyUI. The pack's only real dependency is requests; no models to download and no API key required for this node.

    CategoryCivitai-mcp

    Inputs (1)

    NameTypeDefaultDescription
    model_version_idINT00–18446744073709550000

    Outputs (7)

    NameTypeDescription
    model_idINT
    model_nameSTRING
    version_nameSTRING
    base_modelSTRING
    trigger_wordsSTRING
    air_urnSTRING
    download_urlSTRING