📤 Extract Workflows to JSON
Back up every workflow in your output folder before it's too late
- STRING
The backup you didn't know you needed
You've been generating for months, and every output file quietly carries the workflow that made it - which is exactly how "workflow included" became the community norm. But those files will get re-encoded, stripped, or re-uploaded at some point, and EXIF is usually the first thing to go. ExtractWorkflowsToJSON is the insurance policy: point it at a folder and it walks every image, pulls out the embedded workflow, and writes it to a .json file. Now your workflows live on as plain text, independent of the images that carried them.
How it works
You give it an input folder and an output folder. It scans for .jpg, .jpeg, and .webp files, opens each one, reads the EXIF UserComment, and decompresses anything tagged COMPRESSED:. If there's no compressed tag, it falls back to the image's prompt text. Whatever it finds gets dumped to disk as JSON. When it's done it returns a status string - Processed 120 images: 118 workflows extracted to JSON, 0 errors. - so you know what happened at a glance.
Note what it does not touch: PNG. Core ComfyUI PNGs store workflows in a text chunk rather than EXIF, and this node doesn't read that. For a standard PNG, just drag it into ComfyUI and export the workflow - or feed it through ConvertToCompressed first.
Inputs that matter
Five inputs, and you'll set most of them at some point:
- input_folder / output_folder - where to scan and where to write. Both default to the output directory, so by default JSON lands next to your images.
- recurse - walk subfolders or just the top level. On by default, which is what you want for a real output archive.
- use_image_name - name the JSON after the image (
image_001.png→image_001_workflow.json). Off, and you getworkflow_00001_workflow.jsonstyle names. Keep it on. - append_suffix - what gets appended to the name. The default
_workflow.jsonis fine.
The single STRING output is the status message. It's not an output node - nothing to wire downstream, it just does its job when you queue it.
Install
Same one-liner as every node in this pack:
cd <ComfyUI>/custom_nodes
git clone https://github.com/jonstreeter/comfyui-compressed-metadata
pip install -r comfyui-compressed-metadata/requirements.txt
Or ComfyUI Manager → search "Compressed Metadata", then restart. The only dependency beyond what ComfyUI ships is piexif; no models, nothing heavy.
Gotchas
- Only reads files that still have EXIF. An image that already had its metadata stripped is skipped silently - which is why you run this before uploading things, not after.
- Corrupt payloads are skipped but counted. The status string reports the error count; the console has the per-file details.
- JSON lands beside the images by default. Fine for a personal archive, mildly annoying in a shared directory. Set
output_folderif you want them gathered up. - It's a per-image dump, not a merge. Every image with a workflow gets its own file. That's usually what you want - it keeps the provenance of each generation intact.
If you've got a folder of JPEG/WebP output that came from this pack or from any EXIF-carrying source, run this once and stop worrying about the re-encode.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| input_folder | STRING | /tmp/ComfyUI/output | — |
| output_folder | STRING | /tmp/ComfyUI/output | — |
| recurse | BOOLEAN | true | — |
| use_image_name | BOOLEAN | true | — |
| append_suffix | STRING | _workflow.json | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |