Civitai Get Image
Pull any Civitai image straight into your workflow as a tensor
- image
Civitai's sample images are the single best style reference library in the space - every one carries its full generation recipe, and people routinely use them as img2img seeds, ControlNet sources, or upscaling fodder. Normally you'd save the file to your input folder, reload it, and hope the metadata survives the round trip. This node skips all that: give it an image ID and it downloads the actual image bytes and returns a ComfyUI-ready IMAGE tensor you can wire straight into preview, upscale, or img2img nodes.
The two inputs
image_id(INT, required) - the numeric ID from a Civitai image URL. When you're looking atcivitai.com/images/12345678, that's your ID.max_rating(required, defaultXXX) - a content gate, one ofPG,PG-13,R,X,XXX. This is how the pack keeps you from pulling content you don't want (or, more importantly, content you shouldn't have on your screen) without realizing it. Set it low if you're filtering for clean reference material.
One output: image, the tensor. It's not an output node, so it feeds downstream like any other image source.
How it works
No magic, no API key required. The node resolves the image's current URL through Civitai's public REST API (/api/v1/images?imageId=...), downloads the bytes, decodes them with PIL, and converts to a [1, H, W, 3] float tensor normalized to 0–1 - the standard ComfyUI image format. The max_rating value maps onto the API's nsfw/browsingLevel filters.
Where people get burned
Two traps worth knowing about. First, the rating gate has teeth: if the image exists but exceeds your selected max_rating, the API returns nothing, and the node - after double-checking at the XXX level - raises an error that literally tells you to raise max_rating. So a PG-filtered query that comes back empty doesn't mean the image is gone; it usually means the image is racier than your filter. Second, an image_id of 0 (or any invalid value) doesn't error - it returns a black 64×64 placeholder tensor. That's fine if you're building a fallback branch, but it's a silent trap if you expected a real image.
One more thing about IDs
Image IDs are not stable across the site's churn. Civitai's archives and purges mean an ID can 404 months later - the platform removed 730K images in 2024 alone - so this node is best used on images you saw recently. For the metadata that travels with those images, pair it with Civitai Get Image Metadata, which reads the same API call and hands back the prompt, seed, sampler and everything else as separate typed outputs.
Installing it
ComfyUI Manager, search ComfyUI Civitai MCP, or clone:
cd ComfyUI/custom_nodes
git clone https://github.com/daceheg/ComfyUI-civitai-mcp.git
Restart after. The only real dependency is requests; no models to download, no key required for this particular node.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| image_id | INT | 00–18446744073709550000 | — |
| max_rating | COMBO | XXX | 5 options: PG, PG-13, R, X, XXX |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |