π Save Compressed Image
Save a JPEG that still has your workflow inside
- images
The problem it kills
ComfyUI embeds your workflow into output PNGs as a text chunk. Drag the PNG back in and the whole graph reconstructs - it's the reason "workflow included" became the community norm in the first place. The catch is that PNGs are huge, and the places you actually post (Discord, forums, galleries) are JPEG/WebP territory. The moment you convert, the text chunk is gone and the workflow dies with it.
SaveImageCompressed is the fix. It's a drop-in replacement for the built-in SaveImage that writes JPEG or WebP and tucks a compressed copy of the UI graph into the EXIF metadata. Share the JPEG, and anyone with this pack installed can drag it back onto the canvas and get the full pipeline. Same save node, different file format, workflow intact.
How it works
Two halves, one in the browser and one in Python. A tiny frontend script patches ComfyUI's getPrompt so the serialized UI graph rides along in extra_pnginfo when the node fires. The node then takes that JSON, zlib.compresses it, base64-encodes it, and writes it to the EXIF UserComment field with a COMPRESSED: prefix. On the way back in, the pack's drop handler reads the EXIF, inflates the blob with pako, and calls loadGraphData to rebuild the graph.
The workflow round-trip is lossless - the compression only exists to fit the metadata, not to degrade it. The image itself is a perfectly ordinary JPEG/WebP that anything can open.
Inputs that matter
Only four, and it's an output node, so nothing comes out of it:
- images - the IMAGE tensor, wired to whatever you already feed into SaveImage.
- format - JPEG or WebP. Reach for WebP if your workflows are chunky.
- quality - 1β100, defaults to 95. That default is a sane place to stay.
- filename_prefix - the same prefix + counter naming scheme as the core node.
One hidden thing worth knowing: extra_pnginfo is injected by the pack's JS, so the workflow only gets embedded when that frontend script is loaded - which it is, once the pack is installed.
Install
ComfyUI Manager β search "Compressed Metadata" β install, or:
cd <ComfyUI>/custom_nodes
git clone https://github.com/jonstreeter/comfyui-compressed-metadata
pip install -r comfyui-compressed-metadata/requirements.txt
Then restart. The only real dependency is piexif (Pillow and numpy are already ComfyUI's own). No models to download, nothing heavy.
Where people get burned
- Big workflows silently become WebP. The pack treats ~64 KB as the soft ceiling for JPEG EXIF payloads. If your compressed workflow exceeds it, the node switches that file to WebP even though you asked for JPEG. It's printed to the console, so glance there.
- Viewers strip EXIF. The README warns about it, and it's a real habit: some platforms and editors re-encode and drop metadata. If the workflow matters, keep the original file.
- The drop handler needs internet. Recovering a workflow in the browser pulls ExifReader and pako from a CDN. Offline, you can still pull the workflow out with the pack's LoadCompressedWorkflow node, which runs server-side.
A fair warning on the social side: this only pays off when the person on the other end has the pack installed too. Without it, the image carries a harmless fallback note telling them to install it - a nice touch, but it means the workflow isn't magically readable by plain ComfyUI.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | β | |
| filename_prefix | STRING | ComfyUI | β |
| quality | INT | 951β100 | β |
| format | COMBO | JPEG | 2 options: JPEG, WEBP |
Outputs (0)
No outputs