K3NK Save & Compress ποΈ
Save Images 60% Smaller and Still Drag Them Straight Back Into ComfyUI
- images
ComfyUI's normal save node has a dirty secret: PNGs coming off a diffusion model are fat. A typical Flux image saves at 2β4 MB, and when you're shipping a batch to a gallery, a Discord, or a client, that's a lot of dead weight. K3NK Save & Compress ποΈ is a drop-in image saver that runs TinyPNG-style compression on the way out - and here's the part most compressors get wrong: it keeps the workflow metadata intact, so the saved file still drags back into ComfyUI and reconstructs your whole graph.
That metadata trick is the differentiator. Plenty of tools will shrink your PNG, but they strip the embedded prompt/workflow chunks in the process, and you lose the "post the image, share the workflow" culture ComfyUI is built around. This node extracts the text chunks before compressing and re-injects them after, because pngquant and oxipng would happily delete them.
How it works
Two well-known open-source tools do the work, and the node auto-downloads their binaries from GitHub Releases on first use - no manual install:
- oxipng (MIT) - lossless PNG recompression, the safe baseline.
- pngquant (GPL v3, by Kornel LesiΕski) - lossy quantizer that reduces the color palette; this is where the big size drops come from.
The README's numbers for typical Flux images are worth believing: lossless oxipng gets you ~5β10% smaller, pixel-perfect; adding pngquant on top lands ~50β70% smaller while looking identical. For a batch of render outputs, that's the difference between a 100 MB upload and a 40 MB one.
Pick a compression_mode: none (baseline save), lossless (oxipng), or lossy+lossless (pngquant+oxipng). The quality knobs are quality_min/quality_max (pngquant's allowed quality range, default 85β100) and pngquant_speed (1 = slowest/best, 10 = fastest). oxipng_level 1β6 trades time for compression. For WEBP/JPEG output, lossy_quality (default 90) applies instead.
The inputs that matter
images- the batch to save.filename_prefix- defaultk3nk/image; subfolders work, and it supports%date:format%tokens (e.g.%date:yyyy-MM-dd%) so you can auto-organize by day.format- PNG, WEBP, or JPEG. WEBP/JPEG are inherently lossy and ignore the pngquant/oxipng modes.compression_mode- see above. Start withlossless (oxipng)if you're nervous; the lossy+lossless tier is where the dramatic savings live.
It's an output node - no image outputs, it just writes files and reports them to the UI.
Installing it
ComfyUI Manager β search ComfyUI-K3NKImageGrab, or:
cd ComfyUI/custom_nodes
git clone https://github.com/K3NK3/ComfyUI-K3NKImageGrab
Restart, and the first PNG save will pull the binaries down into the node's bin/ folder (needs internet once). If the download fails, it degrades gracefully to uncompressed output and logs a message.
Where people get burned
The main one is expecting compression and pixel-perfect fidelity at the pngquant tier - you can't have both; that's what lossy means. Keep quality_min high (85 is a sane floor) and you won't see the difference, but on flat-color or text-heavy images pngquant can band visibly, and the node can't warn you.
Also: the license notice is real, not cosmetic. pngquant is GPL v3, so think twice before distributing a build that bundles these binaries inside a proprietary product - the README explicitly disclaims authorship of the binaries, but that doesn't make the GPL go away for redistributors. For personal and most workflow-sharing use it's a non-issue.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | β | |
| filename_prefix | STRING | k3nk/image | β |
| format | COMBO | 3 options: PNG, WEBP, JPEG | |
| compression_mode | COMBO | 3 options: none, lossless (oxipng), lossy+lossless (pngquant+oxipng) | |
| quality_min | INT | 850β100 | β |
| quality_max | INT | 1000β100 | β |
| pngquant_speed | COMBO | 4 options: 1 (slowest/best), 3 (balanced), 6 (fast), 10 (fastest) | |
| oxipng_level | INT | 21β6 | β |
| lossy_quality | INT | 901β100 | β |
Outputs (0)
No outputs