CivitAI Image Preview
Turn any CivitAI image — even a protected one — into an img2img input
- image
- Image
The CivitAI Image Preview node is the one node in the CivitAI ImagePlus pack that actually touches pixels. When you browse the CivitAI gallery from inside ComfyUI, this is the node that shows the selected image in your graph and hands you a real IMAGE tensor you can feed straight into a VAE Encode for img2img - no downloading, no dragging a file from your browser into a Load Image node. Pick an image in the gallery, confirm it here, and it's your init image.
The thing that makes it genuinely useful: protected images. CivitAI lets creators lock images behind an API key, and the normal "right-click, save, drag into ComfyUI" dance just gets you an access-denied placeholder. This node fetches those server-side. The API key lives in api_key.txt in the pack's folder and never touches your browser - the backend grabs the image, hands a tensor to ComfyUI, and you never see the key or the failure state you'd otherwise hit. This is also why the pack carries a patched request-forgery (SSRF) issue in its history; the fetch is now locked down to an allowlist of civitai.com and civitai.red hosts, with a 50 MB cap and a redirect limit.
How it works
Don't expect to wire anything into it - the interesting data path is invisible. When you select an image, the pack's JavaScript pushes the image URL to a backend route (/civitai_gallery/set_preview) keyed to this node's ID. On the next execution the node reads that stored URL, fetches the image server-side, and converts it to a tensor. An IS_CHANGED revision counter makes sure the node actually re-runs when you pick a different image instead of returning a stale cached tensor. That "instantly updates without queuing" behavior is the pack's whole party trick, and this node is where it pays off.
The inputs and outputs that matter
There's only one of each, which makes this easy:
image(optional,IMAGE) - a pass-through. If you wire something in, the node ignores the gallery entirely and just echoes your input back out. Handy for dropping the node into an existing img2img chain without breaking it, or for using it purely as a viewer.Image(IMAGE) output - the selected CivitAI image as a tensor, ready forVAE Encode→KSampler(dropdenoisebelow 1.0) → decode. This is the img2img connector.
The node also carries two buttons: Open Image (opens the proxied preview in a browser tab - a v0.3.1 fix stopped it opening duplicate tabs) and Copy CivitAI Page URL, which copies the civitai.com or civitai.red page link so you can share the source.
Installing it
Same path as any custom node. Fastest is ComfyUI Manager: search for CivitAI ImagePlus and install, then restart. Manual works too:
cd ComfyUI/custom_nodes
git clone https://github.com/CovertBannana/ComfyUI_CivitAI_ImagePlus.git
Dependencies are blessedly light - just aiohttp, numpy, Pillow (torch comes from ComfyUI itself), so there's no model download and no heavy pip install. To unlock protected images, create custom_nodes/ComfyUI_CivitAI_ImagePlus/api_key.txt containing CIVITAI_API_KEY=YOUR_KEY_HERE and restart. Without the key, everything else works; only protected images stay blocked.
Where people get burned
- Nothing updates after picking an image: the pack lives in the frontend as much as the backend. Restart ComfyUI and hard-refresh the browser (
Ctrl+F5) - stale JS is the classic culprit. - Protected images won't preview: check the
api_key.txtformat (CIVITAI_API_KEY=prefix on its own line) and restart. - Standalone, it's useless: without the gallery's JS driving it, this node is just a pass-through. It belongs in a workflow with the CivitAI Gallery node - that's the hub that feeds it.
One honest caveat: the README itself notes this pack is being folded into the author's newer unified ComfyUI-ImagePlus node set. This one still works fine, but if you're starting fresh you might peek at the successor before committing a workflow to this layout.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| imageopt | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| Image | IMAGE | — |