ComfyUI Node

Save_as_jpg

A Save Image that actually writes JPG, with a quality dial

By Fictiverse·Created 3 years ago·Updated 23 days ago· 27
Save_as_jpg
  • images
    filename_prefixComfyUI
    compression80

    ComfyUI's built-in Save Image writes PNGs, full stop. PNG is lossless and great, but it's also huge and sometimes not what you want. Save_as_jpg is the drop-in replacement that writes JPEGs instead, with a compression-quality slider you actually control. That's the entire pitch, and it's a legitimately useful one.

    Why bother? JPEG is what you reach for when file size matters more than pixel-perfection. Smaller files for sharing, for uploads to social sites, for bulk storage of a large batch, or for anything downstream that re-encodes anyway. If you're generating hundreds of images for a dataset or a contact sheet, the size difference between PNG and a quality-80 JPEG adds up fast. And when you want to stop generation with a lossy file, the quality dial is the thing the core save node just doesn't have.

    How it works

    It's a standard output node, structurally a sibling of ComfyUI's own save node: it writes into your ComfyUI/output folder, auto-increments a counter in the filename so you never overwrite (ComfyUI_00001_.jpg, ComfyUI_00002_.jpg, ...), and - the useful extra - substitutes %width% and %height% in the filename prefix if you include them. Want filenames like portrait_1216x832_00003_.jpg? Write portrait_%width%x%height% as the prefix. It also honors subfolders: batch1/portrait saves into output/batch1/. The compression value maps directly to JPEG quality - 80 is a good default, 90+ if you care about the file, low values if you're space-starved.

    Inputs and outputs

    • images (IMAGE) - one image or a batch; every frame gets its own numbered file.
    • filename_prefix (STRING, default ComfyUI) - base name, supports subfolders and %width%/%height%.
    • compression (INT, 10–100, default 80) - JPEG quality. Lower = smaller and uglier.
    • No outputs. It's a terminal node; results show up in ComfyUI's image panel like any save.

    Installing it

    Part of ComfyUI Fictiverse Nodes, a small dependency-free pack - nothing to pip-install beyond ComfyUI itself, no models.

    • ComfyUI Manager → search ComfyUI Fictiverse Nodes → Install, restart.
    • Or: cd ComfyUI/custom_nodes && git clone https://github.com/Fictiverse/ComfyUI_Fictiverse, restart.

    Common issues

    The one thing to keep in mind is that JPEG is lossy, and the compression slider is a real trade: quality 50 and below gets visibly crunchy, especially on fine detail and edges - fine for previews, wrong for anything you'll edit later. Also, unlike PNG, JPEG strips ComfyUI's embedded workflow metadata by default here - if you rely on dragging a saved image back into ComfyUI to recover its workflow, this node will frustrate you. Save a PNG copy for the workflow-embedded master and use JPG for the shareable version.

    Pack-level note: Fictiverse nodes ride along in shared workflows, and if you load one without the pack you'll get ModuleNotFoundError: No module named 'custom_nodes.ComfyUI_Fictiverse'. Install the pack and restart to clear it.

    CategoryFictiverse

    Inputs (3)

    NameTypeDefaultDescription
    imagesIMAGE
    filename_prefixSTRINGComfyUI
    compressionINT8010–100

    Outputs (0)

    No outputs