π― YFG CivitAI MetaSave V2
Your CivitAI uploads keep showing 'no resources used'? This node fixes that.
- images
- filename
- filepath
Here's the situation this node exists for: you render something in ComfyUI, drag the PNG onto CivitAI, and the page lists the checkpoint and LoRAs under "used resources" as empty, with a prompt it can't decode. It's not you doing something wrong. The stock SaveImage node writes ComfyUI's own workflow JSON into the PNG - great for dragging the image back into ComfyUI, useless to CivitAI, which is built to read the A1111-style parameters text chunk instead. That mismatch has annoyed ComfyUI users for years (there's a whole family of "how do I make CivitAI see my resources?" threads on r/civitai).
YFG CivitAI MetaSave V2 is the fix: a drop-in replacement for SaveImage that embeds the exact A1111-compatible metadata chunk CivitAI parses - model, LoRA and embedding hashes, sampler settings, seed, and both prompts - so your uploads get their resource list and generation info filled in automatically, exactly like A1111 outputs do. It's part of the YFG Comical pack (the "πΈ YFG Comical Nodes" collection), and it's the second generation of the pack's MetaSave node: V1 is frozen so old workflows never break, and V2 is where new work happens. Both can sit in the same workflow.
How it works
Under the hood it does a metadata capture pass over the upstream graph: it walks back from the node, picks up the seed, sampler, steps, CFG, dimensions and prompts, and detects LoRAs both from LoraLoader nodes and from inline <lora:name:weight> syntax in the prompt text. Each model file is SHA-256 hashed (first 10 hex chars, which is what CivitAI matches against) and the hashes are cached on disk in civitai_metasave/.cache/model_hash_cache.json, so the first save of a workflow is slow and every run after is not.
The A1111 parameters chunk goes into a PNG text chunk for PNG output; for JPG and WebP it goes into the EXIF UserComment instead, so CivitAI can still read it. The full ComfyUI workflow JSON rides along too (that's the default metadata_scope of full), so you don't lose the "drag the image back into ComfyUI" superpower that made workflow-in-image a community norm in the first place.
The inputs that matter
Most of the defaults are right. The ones you'll actually touch:
images- the IMAGE output from your VAE decode. That's the only required wiring.filename_prefix- defaults toComfyUI, but this is where V2 earns its keep. It supports tokens like%date:yyyy-MM-dd%,%seed%,%model%,%width%,%height%, prompt truncation via%pprompt:32%/%nprompt:32%, and - the new bit - any extra metadata field you define:%extra:Prompt Index%, or%KEY%for captured fields like%Steps%or%Sampler%.metadata_scope-fullembeds A1111 parameters + workflow;defaultbehaves like the stock SaveImage;parameters_only/workflow_only/nonetrim it down.extra_key1/extra_value1- your first custom metadata pair, e.g. keyPrompt Index, value wired from a random-prompt node. Fill one in and another pair appears below it, up to 32. V1 was stuck at four fixed pairs; V2 grows as you use it.output_formatandquality-png,jpg, orwebp(jpg/webp quality is an integer 1β100, ignored for PNG).save_workflow_jsonoptionally writes the workflow as a sidecar.jsonnext to the image.
It also returns two outputs, filename and filepath, which V1 didn't have - handy for piping the saved location into a logger or display node.
Installing it
Same install as any node from this pack:
cd ComfyUI/custom_nodes
git clone https://github.com/gonzalu/ComfyUI_YFG_Comical
β¦then restart ComfyUI. Or just search "YFG Comical Nodes" in ComfyUI Manager and hit install - easiest path. The node needs piexif for the EXIF embedding; it's declared in the pack's pyproject.toml so Manager pulls it in automatically. If you cloned manually and see an import error mentioning piexif, pip install piexif fixes it.
Where people get burned
- "Steps not found in metadata!" warning, parameters string skipped. This is deliberate, not a bug - CivitAI requires a Steps value, so the node won't write a parameters chunk it can't complete. Some upstream sampler setups don't expose steps; that's the one real gotcha.
- A filename token that doesn't resolve is replaced with nothing and logged to the console, so a typo like
%seed%vs%Seed%(both fine, matching is case-insensitive) silently drops out of the name but stays visible in the log. - An extra pair with a value but no key raises an error rather than quietly losing data. Empty-key pairs are skipped.
It's a save node, not a fun one, but if you post to CivitAI with any regularity it quietly fixes a real annoyance - and the filename tokens alone are worth the install if you've ever hand-renamed batches by seed.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | The images to save. | |
| filename_prefix | STRING | ComfyUI | Prefix for the saved filename. Built-in tokens: %date:yyyy-MM-dd% %seed% %model% %width% %height% %pprompt:32% %nprompt:32% (:N truncates to N chars) Custom metadata tokens: %extra:KEY% value of the extra metadata field named KEY %extra:KEY:12% same, truncated to 12 characters %KEY% extra field KEY, or any captured metadata field such as %Sampler%, %Steps%, %CFG scale% Key matching is case-insensitive. Unresolved tokens are replaced with nothing and logged to the console. A literal / creates a subfolder; slashes inside substituted values are made safe. |
| subdirectory_name | STRING | Optional sub-folder inside the output directory. Supports the same tokens as filename_prefix. Leave blank for the default output folder. | |
| output_format | COMBO | png | Image format to save. png β lossless, metadata stored in a PNG text chunk jpg β lossy, metadata stored in EXIF UserComment webp β metadata in EXIF; lossless when quality is 100 |
| save_workflow_json | BOOLEAN | false | Also write a sidecar .json file containing the raw ComfyUI workflow alongside the image. |
| quality | INT | 1001β100 | Compression quality for jpg and webp. 100 is best quality (and lossless for webp). Ignored for png. |
| metadata_scope | COMBO | full | full β A1111 parameters + full ComfyUI workflow default β same as the built-in SaveImage node parameters_only β A1111-style parameters string only workflow_only β ComfyUI workflow JSON only none β no metadata embedded |
| filename_numbering | COMBO | always | always β every file is numbered, including the first on_conflict β first file is unnumbered; a number is only added when the name already exists |
| numbering_start | INT | 10β999999 | First number to use. 0 starts at 0000, 1 starts at 0001. |
| numbering_padding | INT | 51β10 | Digits to pad the number to. 5 gives 00001, 4 gives 0001. |
| include_batch_num | BOOLEAN | false | Append a 5-digit batch index to the filename when saving multiple images from one run. |
| prefer_nearest | BOOLEAN | true | When multiple upstream nodes provide the same metadata field, prefer the one closest (fewest graph hops) to this node. |
| extra_key1opt | STRING | Metadata key, e.g. 'Prompt Index'. Also usable in filename_prefix as %extra:Prompt Index%. Fill this in and another pair appears below. | |
| extra_value1opt | STRING | Metadata value. Type it, or wire it from another node β numbers and strings are both accepted. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| filename | STRING | Filename of the last image saved this run, including extension. |
| filepath | STRING | Full absolute path of the last image saved this run. |