🐟Image Compressor
Shrink your ComfyUI outputs without a round trip through another app
- images
- compression_info
- images
ComfyUI's default Save Image node writes full, uncompressed PNGs - great for quality, terrible for disk space and upload times. If you've watched an output folder balloon into gigabytes, or tried sending a render to a client over a slow connection, this node is the fix: it re-encodes whatever image tensor you feed it into a smaller PNG, WEBP, or JPEG, with real control over how much quality you're trading for size.
What it does and where it fits
Think of it as a drop-in replacement for Save Image when file size actually matters - batch jobs you're archiving, images headed to a web gallery, anything going over an API where bytes cost you time or money. It sits where Save Image would, takes the same IMAGE tensor, and does the compression internally instead of you shelling out to a separate tool afterward. It also passes the compressed image back out as an IMAGE, so it's not just a terminal node - you can keep wiring the smaller version into whatever comes next.
How it works
Nothing exotic: you pick an output format, and the node applies that format's normal compression knobs. PNG is lossless - compression_level trades encode time for file size, not quality, since PNG never throws away pixel data. WEBP and JPEG are lossy, and both use quality to control how aggressively they discard detail. On top of that there's resize_factor, the blunt instrument - shrinking the actual pixel dimensions before compressing is often the single biggest lever for file size, bigger than any quality slider. It also handles RGBA transparency per format sensibly: PNG and WEBP keep the alpha channel, JPEG can't represent transparency at all, so it gets flattened onto a background.
The inputs and outputs that matter
Most of the fields are ones you'll set once and forget:
images- yourIMAGEtensor, from a VAE Decode or anywhere upstream. Handles single images and batches alike.format-PNG,WEBP, orJPEG. PNG for lossless plus transparency, WEBP for a good size/quality balance with transparency, JPEG for photo-style images with no alpha.quality(1–100, default 85) - only matters for WEBP/JPEG. 85–95 "looks the same," 75–85 "fine for most uses," below 75 you'll start seeing it.compression_level(0–9, default 6) - only matters for PNG. Higher squeezes harder and takes longer to encode; doesn't touch quality, since PNG is lossless regardless.resize_factor(0.1–1.0, default 1.0) - scales the image before compressing. Leave at 1.0 for full resolution; drop it for smaller files at lower res.save_image(default on) - write the file to disk, versus just converting in memory and returning it via the outputs.output_prefix(defaultcompressed_) andoutput_path- filename prefix and destination folder. Blank lands inoutput/compressed; relative is relative to ComfyUI'soutputfolder; absolute is used exactly.
Two outputs: compression_info, a string with original size, compressed size, ratio, and save path (wire it into a Show Text node to see the win), and images, the compressed tensor, ready to feed onward.
Installing it
Easiest path is ComfyUI Manager - search ComfyUI-Image-Compressor, install, restart. By hand:
cd ComfyUI/custom_nodes
git clone https://github.com/liuqianhonga/ComfyUI-Image-Compressor
Restart. No models to download, no heavy dependencies - it's just image encoding, one of the lighter installs you'll do. Find it under image → Image Compressor.
Common issues & troubleshooting
You lost the embedded workflow when you reopened the image later. Worth knowing before it costs you a workflow: ComfyUI's own Save Image node embeds the full workflow JSON into the PNG's metadata - that's how "drag the image back into ComfyUI" works, and it's a real community habit for sharing pipelines. Re-encoding through this node, especially converting to JPEG or WEBP, isn't guaranteed to carry that metadata along. If you want both a small file and a shareable workflow, keep a Save Image node in the graph alongside this one rather than replacing it outright.
File size barely moved. Check which knob you actually turned. quality does nothing for PNG, compression_level does nothing for WEBP/JPEG - they're format-specific, so tweaking the wrong one for your chosen format is a silent no-op. If you're already at a sensible quality and still too big, resize_factor is the bigger lever.
JPEG output looks wrong on a transparent image. Expected - JPEG has no alpha channel, so transparency gets flattened to a background color. Use PNG or WEBP if you need to keep it.
Files aren't landing where you expect. output_path is relative to ComfyUI's output directory unless you give it an absolute path - my_folder becomes output/my_folder, not a folder next to your workflow file.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| format | COMBO | 3 options: PNG, WEBP, JPEG | |
| quality | INT | 851–100 | — |
| resize_factor | FLOAT | 1.00.1–1 | — |
| compression_level | INT | 60–9 | — |
| save_image | BOOLEAN | true | — |
| output_prefix | STRING | compressed_ | — |
| images | IMAGE | — | |
| output_pathopt | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| compression_info | STRING | — |
| images | IMAGE | — |