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:
39
snapshot_node.py
Normal file
39
snapshot_node.py
Normal 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,)
|
||||
Reference in New Issue
Block a user