π Load Compressed Workflow
Pull a workflow out of an image without the drag-and-drop
- STRING
What it's actually for
If you dragged a JPEG saved by this pack onto the canvas and the workflow came back - that wasn't this node. Drag-and-drop loading is done by the pack's frontend script, invisibly, the same way core ComfyUI reconstructs a workflow from a PNG. LoadCompressedWorkflow exists for when you want the workflow as a JSON string inside a running workflow: to inspect it, archive it, or hand it to another node that consumes workflow JSON. It's the plumbing node of the pack, and honestly the one most people never touch unless they're scripting something.
How it works
You give it an absolute path to an image. It opens the file with Pillow, reads the EXIF UserComment, strips the 8-byte EXIF header and trailing nulls, and - if the payload starts with COMPRESSED: - base64-decodes and zlib-decompresses it back into the original workflow JSON. No browser involved; this runs server-side in Python, so it works offline and in headless setups where the drag-and-drop handler never fires.
If the tag is missing but the image has prompt text, it falls back to returning that instead. If there's no EXIF, no UserComment, or a corrupt payload, it raises - you'll see the error in the console, and the node goes red.
Inputs and outputs
One input, one output. That's the whole schema:
- image_path - absolute filesystem path to the image. Defaults to empty, and an empty path raises immediately, so fill it in.
- STRING output - the decompressed workflow JSON (or the prompt text fallback) as a single string.
There's nothing to tune. No quality knob, no format picker. Feed it a path, get a string.
When you'd actually use it
Say you batch-converted a folder with ConvertToCompressed and want to verify a file's workflow survived, or you're building automation that pulls workflows out of a pile of images to re-run them. It pairs neatly with LoadWorkflowJSON from the same pack (reads a .json file, returns the string) if you want to round-trip: extract to JSON, load from JSON, feed the string forward to whatever consumes it.
Mostly, though, drag-and-drop gets you 90% of the way. Treat this node as the escape hatch for the other 10% - the offline case, the scripting case, and the "I want the raw JSON in my hand" case.
Install
Same pack as the rest of the Compressed Metadata family:
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. Requires only piexif on top of what ComfyUI already ships.
Gotchas
- Absolute paths only. It won't resolve against the ComfyUI output folder or your home directory - give it the real path.
- Standard PNGs raise "No EXIF found." That's expected, not a bug: core ComfyUI PNGs carry workflows in a text chunk, not EXIF. The native loader handles those.
- Errors are loud, not swallowed. A bad image means a red node and a raised error. When you're scripting a batch, that's a feature - you want failures visible rather than silently skipped.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| image_path | STRING | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | β |