🔄 Convert to Compressed Image
Convert your whole output folder and keep every workflow
- STRING
The bulk converter
ConvertToCompressed is the "do my whole output folder at once" node. You've been saving PNGs from core ComfyUI, they're eating disk, and they're too big to post anywhere. This node converts them to JPEG or WebP and re-embeds each workflow - compressed into EXIF - so nothing is lost in the migration. Think of it as the batch version of SaveImageCompressed, pointed at files that already exist instead of the live output stream.
How it works
Point it at a folder. It walks it (recursively, by default) looking for PNG files, opens each one, and reads the workflow JSON out of the PNG text chunk - the same metadata core ComfyUI writes on every save. That JSON gets zlib-compressed, base64-encoded, tagged COMPRESSED:, and written to the EXIF UserComment of a new JPEG/WebP saved alongside the original. RGBA images get composited onto white, CMYK gets converted to RGB, and anything else is forced to RGB. The output keeps the source's stem with the new extension, sitting in the same folder.
One honest caveat from reading the source: the directory walker only collects .png sources. If your folder is already JPEGs or WebP, this node isn't what you want - that's ExtractWorkflowsToJSON's job.
Inputs that matter
Five inputs:
- folder_path - the directory (or a single image file) to process. Defaults to the output directory.
- recurse - descend into subfolders. On by default.
- delete_originals - delete the source PNG after a successful conversion. Off by default, and keep it that way until you've spot-checked output. It's the one destructive input in the pack.
- quality - 1–100, default 95, same as the save node.
- output_format - JPEG or WebP. If you're converting a folder of complex workflows, WebP sidesteps the JPEG EXIF size limit.
The STRING output is a status report - Converted 40 images to JPEG. - with an error count appended if anything failed.
Install
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. Same single piexif dependency, no models to download.
Gotchas
- Outputs sit right next to sources. There's no separate output-folder field - converted files land beside the originals. With
recurseon, that's a lot of mixed folders, so sort or move things after. - Large workflows silently become WebP. Same ~64 KB JPEG EXIF soft limit as the save node: conversions that would overflow get written as WebP with a console message. Don't be confused by the odd
.webpin a folder you asked to convert to.jpg. - delete_originals is permanent. No recycle bin, no undo. Test one folder before you let it clean up a month of generations.
- Skipped silently. PNGs without a workflow text chunk still convert - they just get an empty compressed marker instead. The console tells you which, if you care.
It's a niche tool, but when you need it, it's exactly the right one: one queue, and your whole archive moves from PNG to shareable JPEG/WebP with the workflows intact.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| folder_path | STRING | /tmp/ComfyUI/output | — |
| recurse | BOOLEAN | true | — |
| delete_originals | BOOLEAN | false | — |
| quality | INT | 951–100 | — |
| output_format | COMBO | JPEG | 2 options: JPEG, WEBP |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |