Save Custom JPG Node
Write JPEGs with quality and metadata control
- images
- STRING
The stock ComfyUI saver writes PNG. Sometimes you just want a JPG - for sharing, for uploading somewhere with size limits, for feeding a downstream service that expects JPEG, or simply because you don't need lossless and you don't want the disk hit. This node writes JPEGs directly, with a quality dial and an option to tuck a metadata string into the file.
JPG is the smallest of the common formats and the most universally accepted. The trade is that it's lossy - every save discards some detail, and it can't do transparency. For final display images where neither matters, it's fine and often the right call. For anything you'll re-edit or re-encode, be aware the loss compounds each time.
The inputs that matter
The required naming controls:
- filename_prefix (default
ComfyUI) - the base filename. - subfolder_dir - an output subfolder to keep runs tidy.
The optional ones:
- quality (default 95) - JPEG quality, 0–100. 95 is a sensible high-quality default where compression artifacts are hard to spot; drop toward 80 if you want noticeably smaller files and can live with a little blocking in flat areas. Below that, gradients and skin tones start to show it.
- optimize (default true) - runs the extra Huffman-table optimization pass for a smaller file at the same visual quality. It's on by default and there's rarely a reason to turn it off.
- metadata_string - a string embedded into the file (JPEG carries it in EXIF/comment fields), useful for stashing prompt or run info.
It's an output node, so it saves on every queue. The output is a STRING giving the saved file's path - wire it onward if a later node needs to know where the file went.
WebP vs JPG in this pack
LogicUtils ships a WebP saver too (SaveImageWebpCustomNode). If you're choosing: WebP is smaller than JPG at the same visual quality and does lossless and transparency, so it's the better format on the merits. Reach for this JPG node specifically when something downstream needs a .jpg - an upload target, a legacy tool, a human who asked for one. Otherwise WebP usually wins.
Installing ComfyUI-LogicUtils
ComfyUI Manager: Install Custom Nodes → search "ComfyUI-LogicUtils" → install → restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/aria1th/ComfyUI-LogicUtils
Restart ComfyUI. JPEG saving goes through Pillow, already present in ComfyUI, so nothing extra to install.
Worth knowing
The pack is aria1th's (AngelBottomless) personal utility set, and it's undocumented on purpose - too many small nodes to write up. This one holds no surprises: pick a quality, leave optimize on, and remember JPG is lossy and can't hold transparency. If either of those bites, switch to the WebP saver next door.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| filename_prefix | STRING | ComfyUI | — |
| subfolder_dir | STRING | — | |
| qualityopt | INT | 95 | — |
| optimizeopt | BOOLEAN | true | — |
| metadata_stringopt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |