XWorkflowSave
Save your entire workflow to a JSON file — not just the PNG sidecar
- anything
- anything
- workflow_info
ComfyUI's canonical way to save a workflow is to bake it into a PNG and drag the image back in later. That works, but it's not great for versioning, sharing between machines, or keeping an archive of "this is the exact graph that made this." XWorkflowSave writes the workflow itself out as a JSON file to your output directory - the actual editable graph, on disk, with a timestamped name.
The subtle part is that "the workflow" means two different things in ComfyUI. There's the prompt (the compact graph that actually executes) and there's the full_workflow (the richer editable representation the frontend shows you). A regular save node can't see the second one, because it only lives in the browser. XWorkflowSave gets around that with a frontend extension and a custom API endpoint - which is what makes it genuinely useful instead of just another file writer.
How it works
There are three save modes:
- Native - writes
prompt+workflow(fromextra_pnginfo), the same shape the official SaveImage embeds in PNGs. Compatible with the standard ComfyUI web loader: drag it in and it reconstructs. Nothing special needed. - Prompt+FullWorkflow - writes
promptplusfull_workflow, the complete editable graph. This is the mode you can't easily get any other way: the pack's web extension captures the full workflow from the frontend and POSTs it to the/xz3r0/xworkflowsave/captureAPI, where it's stored in memory keyed by prompt ID. When the node runs it pulls that data back down (with a small retry loop to handle the race between the capture request and execution). - Auto (default) - prefer Prompt+FullWorkflow when the frontend extension is loaded, fall back to Native when it isn't.
You also get a pass-through: the optional anything input accepts any type and returns it unchanged, purely so you can hang this node somewhere in the graph without breaking the flow. And workflow_info (STRING) reports what happened - saved filename, which mode actually ran, the data keys written, and a node-count overview - handy for confirming a save worked.
The inputs that matter
- save_mode - start with Auto and switch to Native if you want maximum compatibility with the stock web loader.
- filename_prefix / subfolder - same datetime tokens as the rest of the pack (
%Y%,%m%,%d%,%H%,%M%,%S%). Subfolder defaults to "Workflows", is single-level, and rejects path separators for the usual sanitization reasons. - anything - optional, only for wiring; the node runs fine with nothing connected.
Installing
Part of ComfyUI-Xz3r0-Nodes. ComfyUI Manager → search "ComfyUI-Xz3r0-Nodes" → install, or:
cd ComfyUI/custom_nodes
git clone https://github.com/Xz3r0-M/ComfyUI-Xz3r0-Nodes.git
cd ComfyUI-Xz3r0-Nodes
pip install -r requirements.txt
Restart ComfyUI. The restart matters double here: the frontend extension that captures full workflows only loads at startup, so a stale ComfyUI session silently drops you into Native mode. No models, no FFmpeg needed for this one.
Gotchas
- Prompt+FullWorkflow needs the web extension loaded, and it only captures when you run via Queue Prompt. If you trigger execution some other way, Auto mode falls back to Native - you'll see it in
workflow_info's "mode" line. - The full-workflow data is stored in memory and cleaned up after saving, so this is for saving, not for keeping a live copy. Save what you need.
- Earlier versions had bugs when a workflow was queued more than once (a v2.5.1 changelog entry fixes exactly that). If the pack is old, update before relying on it - the fix landed for a reason.
- Native-mode files load in the stock web UI, full-workflow files are richer but round-trip through this pack's own capture path. Pick Native when you're sending the file to someone who doesn't have this pack installed.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| save_mode | COMBO | Auto | Save mode: Auto (auto-detect, prefer Prompt+FullWorkflow, fallback to Native), Native (native workflow format, compatible with ComfyUI web), Prompt+FullWorkflow (prompt + full_workflow) |
| filename_prefix | STRING | ComfyUI_%Y%-%m%-%d%_%H%-%M%-%S% | Filename prefix, supports datetime placeholders: %Y%, %m%, %d%, %H%, %M%, %S% |
| subfolder | STRING | Workflows | Subfolder name (no path separators allowed), supports datetime placeholders: %Y%, %m%, %d%, %H%, %M%, %S% |
| anythingopt | COMFY_MATCHTYPE_V3 | Optional pass-through input for workflow connection. This input is not processed, only used to link the node into your workflow. Output type follows the connected input type. Node works without any input. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| anything | COMFY_MATCHTYPE_V3 | Original pass-through input for downstream workflow chaining |
| workflow_info | STRING | Workflow information summary including save status, node count, and data overview. Useful for debugging and verification. |