AI2Go Save Metadata (Civitai)
Your ComfyUI PNGs carry metadata Civitai can't read. This fixes that.
- images
- images
If you upload ComfyUI images to Civitai and the prompt doesn't show up, or the checkpoint and LoRAs don't auto-link, this is the problem: ComfyUI's stock Save Image embeds the raw workflow/prompt graph into the PNG. Civitai can't reliably read that back into a prompt - it expects the flat, human-readable A1111-style parameters text chunk. This node is a drop-in Save Image that writes that chunk: positive, negative, steps, CFG, seed, sampler, scheduler, size, plus model and LoRA AutoV2 hashes.
The trick is that it's not static. It traces the graph at save time and records the prompt that actually ran on this run. For a one-off generation that doesn't sound special, but it matters more than people expect: a dynamic workflow - and the pack's own AI2Go Prompt Batch is the worst case: one graph, N prompts, disambiguated only by a run index - makes a stock Save Image actively misleading. This node gets it right because it walks the live graph.
How the trace works
It walks backward from the saved image's images input to find the KSampler feeding it, falling back to "the only sampler in the graph" if the walk doesn't land on one. From there it reads positive/negative out of the CLIP encode, plus steps/CFG/seed/sampler/scheduler and the model/LoRA chain. When the prompt comes from an AI2Go Prompt Batch node, the trace reads that node's current index and resolves the exact line that ran for this queue item.
The model/LoRA walk recognizes checkpoints and standalone diffusion models (Load Diffusion Model / GGUF unet loaders), and picks up LoRAs from stock Load LoRA as well as rgthree's Power Lora Loader and Lora Loader Stack - several LoRAs in one node included. Disabled rows and empty or zero-strength slots are skipped, matching what actually loads.
What gets written, in A1111 order:
{positive} <lora:name:weight> ...
Negative prompt: {negative}
Steps: …, Sampler: …, CFG scale: …, Seed: …, Size: …, Model hash: …, Model: …, Lora hashes: "...", Version: ComfyUI
Unknown or unresolved fields are omitted, never guessed. If something can't be traced - say, two KSamplers in the graph - it warns you by name in the ComfyUI log, which is your cue to reach for the Advanced version.
The inputs that matter
images- what you're saving.filename_prefix- default "AI2Go"; supports%date:...%tokens like stock Save Image.save_workflow- off by default. Off = the PNG carries only the Civitai chunk. On = it also embeds the ComfyUI workflow/prompt chunks, same as stock Save Image, if you want the graph recoverable from the file.
Both nodes also have a 🔎 Test detection button that runs the trace against the live editor graph and previews what will be saved - positive/negative, sampler settings, model, LoRAs, unresolved fields - before you queue anything.
Hash caching
Civitai matches a checkpoint or LoRA to its page by AutoV2 - the first 10 hex chars of the file's full SHA-256. Hashing a multi-GB checkpoint is slow, so hashes are cached in .hash_cache.json in the pack folder. The first save of a new file pays the cost once; every save after that is instant. One honest caveat from the author: end-to-end verification that a real upload auto-links was still pending when the README was written - the format is what Civitai's docs index against, but don't be shocked if a niche edge case needs a manual check.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/Little-God1983/ComfyUI-AI2Go-Utils
Restart ComfyUI. Pillow is the only dependency and ComfyUI already ships it.
The one assumption to know
These nodes assume one KSampler in the workflow. A hires-fix pass with two samplers isn't disambiguated by the trace - that's exactly the case where you wire the Advanced node's override sockets instead. And remember, this pack is published for reference with issues disabled: you can fork it, just don't file a bug ticket expecting a reply.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | Images to save. | |
| filename_prefix | STRING | AI2Go | Filename prefix (supports %date:...% tokens like Save Image). |
| save_workflow | BOOLEAN | false | Also embed the ComfyUI workflow/prompt chunks (off = only the Civitai `parameters` chunk). |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |