Add SaveSnapshot node with visual separation and rolling limit

Introduce a SaveSnapshot custom node that triggers snapshot captures
via WebSocket. Node-triggered snapshots are visually distinct in the
sidebar (purple left border + "Node" badge) and managed with their
own independent rolling limit (maxNodeSnapshots setting), separate
from auto/manual snapshot pruning. Node snapshots skip hash-dedup
so repeated queue runs always capture.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-24 21:22:53 +01:00
parent 838b3d0b00
commit 3877c5838c
5 changed files with 160 additions and 11 deletions

39
snapshot_node.py Normal file
View File

@@ -0,0 +1,39 @@
from server import PromptServer
class _AnyType(str):
def __ne__(self, other):
return False
ANY_TYPE = _AnyType("*")
class SaveSnapshot:
CATEGORY = "Snapshot Manager"
FUNCTION = "execute"
RETURN_TYPES = (ANY_TYPE,)
OUTPUT_NODE = True
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"value": (ANY_TYPE, {}),
"label": ("STRING", {"default": "Node Trigger"}),
}
}
@classmethod
def VALIDATE_INPUTS(cls, input_types):
return True
@classmethod
def IS_CHANGED(cls, *args, **kwargs):
return float("NaN")
def execute(self, value, label):
PromptServer.instance.send_sync(
"snapshot-manager-capture", {"label": label}
)
return (value,)