diff --git a/README.md b/README.md index c11e56f..996b669 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@

ComfyUI Registry MIT License - Version + Version ComfyUI Extension

@@ -27,6 +27,7 @@ - **Per-workflow storage** — Each workflow has its own independent snapshot history - **Theme-aware UI** — Adapts to light and dark ComfyUI themes - **Toast notifications** — Visual feedback for save, restore, and error operations +- **SaveSnapshot node** — Trigger snapshot captures from your workflow with a custom node; node snapshots are visually distinct (purple border + "Node" badge) and have their own rolling limit - **Lock/pin snapshots** — Protect important snapshots from auto-pruning and "Clear All" with a single click - **Concurrency-safe** — Lock guard prevents double-click issues during restore - **Server-side storage** — Snapshots persist on the ComfyUI server's filesystem, accessible from any browser @@ -105,6 +106,7 @@ All settings are available in **ComfyUI Settings > Snapshot Manager > Capture Se | **Capture delay** | Slider | `3s` | Seconds to wait after the last edit before auto-capturing (1–30s) | | **Max snapshots per workflow** | Slider | `50` | Maximum number of unlocked snapshots kept per workflow (5–200). Oldest unlocked are pruned automatically; locked snapshots are never pruned | | **Capture on workflow load** | Toggle | `On` | Save an "Initial" snapshot when a workflow is first loaded | +| **Max node-triggered snapshots** | Slider | `5` | Rolling limit for SaveSnapshot node captures per workflow (1–50). Node snapshots are pruned independently from auto/manual snapshots | ## Architecture @@ -112,7 +114,7 @@ All settings are available in **ComfyUI Settings > Snapshot Manager > Capture Se Architecture Diagram

-**Data flow:** +**Auto/manual capture flow:** 1. **Graph edits** trigger a `graphChanged` event 2. A **debounce timer** prevents excessive writes @@ -121,6 +123,13 @@ All settings are available in **ComfyUI Settings > Snapshot Manager > Capture Se 5. The **sidebar panel** fetches snapshots from the server and renders the snapshot list 6. **Restore/Swap** loads graph data back into ComfyUI with a lock guard to prevent concurrent operations +**Node-triggered capture flow:** + +1. **SaveSnapshot node** executes during a queue prompt run +2. A **WebSocket event** is sent to the frontend, **skipping hash dedup** (the workflow doesn't change between runs) +3. The snapshot is saved with `source: "node"` and pruned against its own rolling limit (`maxNodeSnapshots`) +4. Node snapshots appear in the sidebar with a **purple left border** and **"Node" badge** + **Storage:** Snapshots are stored as JSON files on the server at `/data/snapshots//.json`. They persist across browser sessions, ComfyUI restarts, and are accessible from any browser connecting to the same server. ## FAQ diff --git a/assets/architecture.png b/assets/architecture.png index 03624a3..2623a93 100644 Binary files a/assets/architecture.png and b/assets/architecture.png differ diff --git a/assets/architecture.svg b/assets/architecture.svg index 77be09a..dbb59b1 100644 --- a/assets/architecture.svg +++ b/assets/architecture.svg @@ -1,93 +1,100 @@ - + - - - - - How It Works - - - - Graph Edit - graphChanged event - - - - - - - Debounce Timer - configurable delay - - - - - - - Hash Check - per-workflow map - - - - - - - - - IndexedDB - persistent storage - - - - - - - Sidebar Panel - - - - Take Snapshot - - - Restore - - - Swap - - - Search - - toast notifications · confirm dialogs · loading states - - - - Restore / Swap - with lock guard - - - - loadGraphData - - - - - - - - - + + + + + + + How It Works + + + + + Graph Edit + graphChanged event + + + + + Debounce Timer + configurable delay + + + + + Hash Check + per-workflow dedup + + + + + + + + + SaveSnapshot Node + queue prompt trigger + + + + WS event · skips hash dedup + + + Server Storage + JSON files · per-workflow dirs + + + + + + + + Sidebar Panel + + + Take Snapshot + + + Restore + + + Swap + + + Search + + + Lock + + toast notifications · confirm dialogs · loading states + + + + Restore / Swap + with lock guard + + + + + + + loadGraphData + + +