Nodes/isekai-comfy-node/Compress and Save
ComfyUI Node

Compress and Save

Save space without a second thought

By isekai-sh·Created 9 months ago·Updated 8 months ago· 3
Compress and Save
  • images
    filenameisekai
    formatJPEG
    quality90

    IsekaiCompressAndSave is ComfyUI's Save Image node with a quality dial. ComfyUI's built-in save dumps lossless PNGs by default, which is great for archival and terrible for your disk when you're generating batches. This node writes JPEG, PNG, or WebP at whatever quality you pick, straight into the output folder. If you're producing images for the web, sharing over Discord, or filling a disk with test batches, this is the node that keeps your storage sane.

    How it works

    It takes your image tensors, converts them to PIL, and saves them with format-specific compression. The quality slider (1–100, default 90) maps differently per format, and the code is upfront about it:

    • JPEG - quality maps directly to JPEG quality. 90 is a safe web default; 70–80 for bulk; below that you'll start seeing blocking.
    • PNG - there's no JPEG-style quality knob, so the node converts quality to Pillow's compress_level (0–9). Higher quality = less compression = bigger file.
    • WEBP - quality maps directly, and at 95+ it switches to lossless mode. WebP at ~85 is the modern "small file, still looks great" choice.

    Filenames get a counter suffix: isekai_00001.jpg, isekai_00002.jpg, and so on, auto-incrementing so you never overwrite. The base name is your filename input (default "isekai").

    A couple of nice touches: unlike most of the pack, this one handles batches correctly - it loops over every image in the batch and saves them all. And it's marked as an output node, so ComfyUI's save-preview infrastructure works with it normally.

    The inputs

    • images - the image or batch to save.
    • filename - base name, default "isekai".
    • format - JPEG, PNG, or WEBP.
    • quality - 1–100, default 90.

    It has no outputs - it's a terminal node, which is what you want from a save.

    Installing it

    Part of isekai-comfy-node:

    ComfyUI Manager: search "isekai" → install isekai-comfy-node → restart. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/isekai-sh/isekai-comfy-node
    cd isekai-comfy-node
    pip install -r requirements.txt
    

    Restart and it's under Isekai → IO. Pillow and requests only; no models, no downloads.

    Common issues

    The one thing people hit: the node writes into ComfyUI's output/ directory (it walks up from the custom_nodes folder to find it), so if you've configured a custom output folder elsewhere, this node may not follow your preference - check where the file actually landed. It's a type: "output" result, so the UI should show it, but files don't appear in ComfyUI's own saved-image browser in some versions. Know where to look.

    Also remember JPEG is lossy. If you're saving a workflow-critical image (say, one you'll feed back into an img2img pass later), use PNG or WebP-lossless at high quality. The whole point of this node is disk savings, but saving a lossy JPEG and then re-generating from it is how you get generational quality loss that has nothing to do with your model.

    CategoryIsekai/IO

    Inputs (4)

    NameTypeDefaultDescription
    imagesIMAGE
    filenameSTRINGisekai
    formatCOMBOJPEG3 options: JPEG, PNG, WEBP
    qualityINT901–100

    Outputs (0)

    No outputs