Civitai Get Image Metadata
Reverse-engineer any Civitai image's generation settings
- 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
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 fromcivitai.com/images/<id>.max_rating(required, defaultXXX) - 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.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| image_id | INT | 00–18446744073709550000 | — |
| max_rating | COMBO | XXX | 5 options: PG, PG-13, R, X, XXX |
Outputs (17)
| Name | Type | Description |
|---|---|---|
| prompt | STRING | — |
| negative_prompt | STRING | — |
| seed | INT | — |
| steps | INT | — |
| cfg_scale | FLOAT | — |
| sampler_name | STRING | — |
| width | INT | — |
| height | INT | — |
| tags | STRING | — |
| stats_json | STRING | — |
| url | STRING | — |
| username | STRING | — |
| base_model | STRING | — |
| post_id | INT | — |
| created_at | STRING | — |
| nsfw_level | STRING | — |
| model_version_ids | STRING | — |