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

Civitai Get Image Metadata

Reverse-engineer any Civitai image's generation settings

By daceheg·Created 3 months ago·Updated 3 months ago· 6
Civitai Get Image Metadata
    • prompt
    • negative_prompt
    • seed
    • steps
    • cfg_scale
    • sampler_name
    • width
    • height
    • tags
    • stats_json
    • url
    • username
    • base_model
    • post_id
    • created_at
    • nsfw_level
    • model_version_ids
    image_id0
    max_ratingXXX

    The classic Civitai workflow has always been: see a killer sample image, then go read its metadata to figure out how it was made. This node does that reading for you, programmatically. Feed it a Civitai image ID and it returns the generation recipe as seventeen separate typed outputs - prompt, negative prompt, seed, steps, CFG, sampler, dimensions, tags, plus a pile of context about the image and its creator.

    The inputs

    • image_id (INT, required) - the numeric ID from civitai.com/images/<id>.
    • max_rating (required, default XXX) - the content gate: PG, PG-13, R, X, XXX. If the image's content exceeds your chosen level, you get an error telling you to raise it.

    What comes out

    The front half is what you actually want for reconstruction:

    • prompt, negative_prompt (STRING) - the positive and negative prompts.
    • seed (INT), steps (INT), cfg_scale (FLOAT), sampler_name (STRING) - the sampler settings.
    • width, height (INT) - dimensions.
    • tags (STRING) - the image's Civitai tags, comma-joined.

    Then the context half, which is easy to overlook and genuinely handy: url (direct image link), username (the uploader), base_model, post_id, created_at, nsfw_level, model_version_ids (which model versions this image was made with), and stats_json - the reaction/engagement counts as a JSON string, useful if you're scraping Civitai engagement for research.

    How it works

    One public REST call to /api/v1/images?imageId=... with withMeta=true and flatMeta=true, so the generation parameters arrive flattened rather than nested. It needs no API key - the endpoint is public - though the pack will use your key as a Bearer token if one is configured.

    Where it gets interesting

    This is the node that makes "copy that style" workflows possible. Wire prompt and negative_prompt into text nodes feeding a sampler, drop seed into your seed widget, and you've reproduced the exact generation recipe - the community's favorite way to learn, and the reason Civitai's ToS requires sexualized content to carry at least the prompt in the first place. Pair it with Civitai Get Image if you also want the actual pixels, or with Civitai Get Model Metadata on the model_version_ids to resolve which checkpoints and LoRAs were used.

    One honest caveat: if the uploader never embedded metadata, meta comes back empty and you get blank strings and zeros - that's Civitai's data problem, not a node bug. Some of the finest-looking images on the site carry no recipe at all.

    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, and since this node rides the public API it works without configuring a key at all.

    CategoryCivitai-mcp

    Inputs (2)

    NameTypeDefaultDescription
    image_idINT00–18446744073709550000
    max_ratingCOMBOXXX5 options: PG, PG-13, R, X, XXX

    Outputs (17)

    NameTypeDescription
    promptSTRING
    negative_promptSTRING
    seedINT
    stepsINT
    cfg_scaleFLOAT
    sampler_nameSTRING
    widthINT
    heightINT
    tagsSTRING
    stats_jsonSTRING
    urlSTRING
    usernameSTRING
    base_modelSTRING
    post_idINT
    created_atSTRING
    nsfw_levelSTRING
    model_version_idsSTRING