lock_workflow
Capture a provenance lock for a saved workflow by recording model file hashes, custom node git commits, and ComfyUI version to enable exact reproduction.
Instructions
Capture a provenance lock for a saved workflow so it can be exactly reproduced later. Walks the workflow's model loaders (CheckpointLoaderSimple, UNETLoader, VAELoader, LoraLoader, ControlNetLoader, etc.), SHA-256s every referenced model file, records the git commit currently checked out for every custom node pack the workflow's class_types come from, and captures ComfyUI's reported version. Writes <filename>.lock.json next to the workflow in ComfyUI's user library. Requires a local install (COMFYUI_PATH) — SHA-256 needs raw file bytes and pack commits come from custom_nodes/*/.git/HEAD. Pair with verify_workflow_lock later to detect drift.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | Workflow filename in the ComfyUI user library (e.g. 'my_workflow.json'). The lock is written as '<filename>.lock.json' alongside. |