[PR #2105] [MERGED] Add Custom Node - Save Checkpoint with Metadata #2283

Closed
opened 2026-10-28 21:08:37 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Comfy-Org/ComfyUI-Manager/pull/2105
Author: @a-l-e-x-d-s-9
Created: 8/25/2025
Status: ✅ Merged
Merged: 8/26/2025
Merged by: @ltdrdata

Base: main ← Head: main


📝 Commits (2)

  • 931ff63 Added entry for ComfyUI-SaveCheckpointWithMetadata
  • 891d343 Added entry for ComfyUI-SaveCheckpointWithMetadata in git-clone section

📊 Changes

1 file changed (+10 additions, -1 deletions)

View changed files

📝 custom-node-list.json (+10 -1)

📄 Description

Summary

Adds a custom node that saves .safetensors checkpoints with explicit control over metadata and filename behavior.

Repository

Motivation

Stock save nodes do not let users fully replace or precisely control safetensors header metadata. This node enables a clean replace or a minimal merge of metadata, and exposes predictable filename policies.

Key Features

  • metadata_json: write exact header keys. Non-strings are JSON-encoded to comply with safetensors.
  • metadata_mode:
    • replace: write only metadata_json.
    • merge_minimal: base header includes prompt and optional EXTRA_PNGINFO, then apply metadata_json (user keys win).
  • prompt_override: visible field to override hidden PROMPT in merge mode.
  • filename_mode:
    • smart_counter: first save uses unsuffixed prefix.safetensors if free; subsequent saves use prefix_00001_, prefix_00002_, etc., based on existing files.
    • no_counter_overwrite: always write to prefix.safetensors and overwrite if it exists.
  • Outputs (STRING):
    • ckpt_path: final file path.
    • saved_metadata: final header JSON written.
    • saved_prompt: value stored under prompt (if any).
    • saved_extra_pnginfo: subset of EXTRA_PNGINFO actually merged.

Security and Behavior

  • No subprocess, no network calls, no file deletion.
  • Writes only to the resolved ComfyUI output path via comfy.sd.save_checkpoint.
  • Tooltips provided for all inputs.

Install Type

git-clone


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Comfy-Org/ComfyUI-Manager/pull/2105 **Author:** [@a-l-e-x-d-s-9](https://github.com/a-l-e-x-d-s-9) **Created:** 8/25/2025 **Status:** ✅ Merged **Merged:** 8/26/2025 **Merged by:** [@ltdrdata](https://github.com/ltdrdata) **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (2) - [`931ff63`](https://github.com/Comfy-Org/ComfyUI-Manager/commit/931ff63d28c9433bf0c35d84a0e179b362ddd8d8) Added entry for ComfyUI-SaveCheckpointWithMetadata - [`891d343`](https://github.com/Comfy-Org/ComfyUI-Manager/commit/891d3435ad5b5e2fe9d9ccf7c46745525f6a476f) Added entry for ComfyUI-SaveCheckpointWithMetadata in git-clone section ### 📊 Changes **1 file changed** (+10 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `custom-node-list.json` (+10 -1) </details> ### 📄 Description ## Summary Adds a custom node that saves `.safetensors` checkpoints with explicit control over metadata and filename behavior. ## Repository - Repo: https://github.com/a-l-e-x-d-s-9/ComfyUI-SaveCheckpointWithMetadata - Author: alexds9 - Dependencies: none ## Motivation Stock save nodes do not let users fully replace or precisely control safetensors header metadata. This node enables a clean replace or a minimal merge of metadata, and exposes predictable filename policies. ## Key Features - `metadata_json`: write exact header keys. Non-strings are JSON-encoded to comply with safetensors. - `metadata_mode`: - `replace`: write only `metadata_json`. - `merge_minimal`: base header includes prompt and optional `EXTRA_PNGINFO`, then apply `metadata_json` (user keys win). - `prompt_override`: visible field to override hidden PROMPT in merge mode. - `filename_mode`: - `smart_counter`: first save uses unsuffixed `prefix.safetensors` if free; subsequent saves use `prefix_00001_`, `prefix_00002_`, etc., based on existing files. - `no_counter_overwrite`: always write to `prefix.safetensors` and overwrite if it exists. - Outputs (STRING): - `ckpt_path`: final file path. - `saved_metadata`: final header JSON written. - `saved_prompt`: value stored under `prompt` (if any). - `saved_extra_pnginfo`: subset of `EXTRA_PNGINFO` actually merged. ## Security and Behavior - No subprocess, no network calls, no file deletion. - Writes only to the resolved ComfyUI output path via `comfy.sd.save_checkpoint`. - Tooltips provided for all inputs. ## Install Type `git-clone` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-28 21:08:37 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Comfy-Org/ComfyUI-Manager#2283
No description provided.