IO Save Image Format (Swwan)
A saver tuned for the tail end of a queue
- image
- out_path
Stock ComfyUI's Save Image is fine until the encode is the bottleneck. On a Replicate-style job, or any queue where you're billed per second of execution, the PNG compression step at the end can eat more wall-clock than the diffusion itself. IO Save Image Format is the answer to that specific annoyance: a saver stripped down to the parameters that actually affect encode time and file size, with defaults tuned for fast export.
The pack README says it plainly: this node cut the metadata and workflow-embedding logic out of format saving, keeping only quality, png_compress_level, optimize, webp_lossless, and webp_method. Nothing else that could slow the tail end of the job survives.
What it does
Required inputs: image, file_format (jpg/png/webp/tif/bmp), output_path (default ./output), and filename_mid (the middle of the output filename). Optional tuning: number_prefix (put the counter before or after the name), number_digits (how many digits the counter pads to), and the encode knobs.
The defaults are where the "fast export" intent lives:
file_format- the node doesn't default it in the schema, but the README's recommended starting point is jpg,quality=88png_compress_level=1- PNG level 9 saves a few percent more but can be an order of magnitude slower; for batch saves, level 1 is the sensible middleoptimize=true- with a built-in fallbackwebp_method=2- WebP's method slider (0–6) is a time/quality trade; low numbers are fast, and the README suggests 0–2 for Replicate
There's a thoughtful detail in the fallback: if a Pillow encoder errors out with optimize=true (some do), the node automatically retries without it instead of killing the whole batch. That's the kind of resilience you want in an unattended queue.
Output: out_path, a STRING list of the absolute paths it wrote - so you can chain the saver's output into a node that needs to know where files landed.
Installing it
It ships in ComfyUI_Swwan:
cd ComfyUI/custom_nodes
git clone https://github.com/aining2022/ComfyUI_Swwan
pip install -r ComfyUI_Swwan/requirements.txt
Or install the pack via ComfyUI Manager, search "ComfyUI_Swwan".
Where people get burned
The counter logic scans the output directory for the highest existing number matching your filename_mid and increments from there, so a mixed-up directory with unrelated numbered files can start you at an unexpected offset - clean the folder if the numbering looks off. And remember this is a bare saver: it writes no workflow metadata into PNGs, so a workflow you save this way won't reconstruct when dragged back into ComfyUI. That's a feature for speed, but a gotcha if you're used to "save PNG, share image, everyone gets the workflow." For reproducible shares you'd want the standard Save Image (with metadata) instead.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| file_format | COMBO | 5 options: jpg, png, webp, tif, bmp | |
| output_path | STRING | ./output | — |
| filename_mid | STRING | tmp | — |
| number_prefixopt | BOOLEAN | false | — |
| number_digitsopt | INT | 51–10 | 编号位数,如设置为3则为001格式 |
| qualityopt | INT | 881–100 | JPEG/WebP 质量。数值越高体积通常越大、保存通常越慢。 |
| png_compress_levelopt | INT | 10–9 | PNG 压缩等级。Replicate 场景建议保持较低数值以减少保存耗时。 |
| optimizeopt | BOOLEAN | true | 启用 Pillow optimize。主要影响 JPEG/TIFF。若编码器报错,节点会自动回退到不使用 optimize。 |
| webp_losslessopt | BOOLEAN | false | 启用无损 WebP。通常会更慢且文件更大。 |
| webp_methodopt | INT | 20–6 | WebP 编码方法。越高通常压得更小,但更慢。Replicate 场景建议使用 0-2。 |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| out_path | STRING | — |