comfyui-checkpoint

Saves and restores ComfyUI workflow snapshots in a SQLite version store indexed by session_id.

Updated Apr 8, 2026
One-click install
npx skills add https://github.com/ShinyGua/ComfyUI-Agent --skill comfyui-checkpoint-shinygua
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: comfyui-checkpoint
Source: https://github.com/ShinyGua/ComfyUI-Agent/tree/main/.claude/skills/comfyui-checkpoint
Command: npx skills add https://github.com/ShinyGua/ComfyUI-Agent --skill comfyui-checkpoint-shinygua

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Agent-driven edits to ComfyUI workflows can corrupt or lose working state, leaving no way to roll back after a failed rewrite or debug step. This Skill freezes workflow state before high-value agent actions and records recoverable versions afterward. ## Core Features & Use Cases - Snapshot Saving: Persist workflow_data, optional workflow_data_ui, and attributes into a SQLite workflow_version table keyed by session_id. - Version Restore: Retrieve the latest snapshot for a session or a specific version by ID, with structured JSON output. - Hook Integration: Wired into PreToolUse hooks so checkpoints happen automatically before file edits and capability executions. - Use Case: Before an agent rewrites a workflow under projects/<id>/inputs/, a checkpoint is saved; if the rewrite breaks the graph, the repairing-workflows flow restores the prior version by session_id. ## Quick Start Ask the agent to save a checkpoint of the current ComfyUI workflow for your session, then restore the latest snapshot for that session after a failed edit.

Frequently Asked Questions about comfyui-checkpoint

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I save and restore a ComfyUI workflow snapshot?▼

Save by piping JSON with session_id and workflow_data to scripts/save.py via stdin, which returns a version_id. Restore with scripts/restore.py using --session-id for the latest snapshot or --version-id for a specific row.

How do I version ComfyUI workflows in SQLite?▼

Each save inserts a row into the workflow_version table with session_id, workflow_data, optional workflow_data_ui, attributes, and created_at. Versions are monotonic per insert, so restoring by session_id returns the latest while --version-id targets any prior row.

Can I call the checkpoint scripts directly from the host?▼

Host callers should use the Python wrapper at host/bridge/checkpoint_client.py instead of shelling out. It speaks the stdin-JSON contract for save.py and the CLI-flag contract for restore.py, raising a structured CheckpointError on failure.

Why does save.py reject CLI arguments?▼

save.py accepts stdin JSON only and has no argparse handling, so passing CLI flags is a historical bug that writes nothing. All input must be a JSON body with session_id and workflow_data sent through standard input.

Where is the checkpoint database stored and can I change it?▼

Snapshots live in a single SQLite file at host/.cache/checkpoint.sqlite by default. Set the COMFYUI_AGENT_CHECKPOINT_DB environment variable to override the path, which the eval suite uses to isolate temporary databases.