Nodes/ComfyUI-JNodes/Save Image With Output
ComfyUI Node

Save Image With Output

One node that's both Preview and Save, with a toggle

By JaredTherriault·Created 3 years ago·Updated about a month ago· 91
Save Image With Output
  • images
  • images
save_to_outputfalse
filename_prefixComfyUI
save_prompt_to_metafalse
metadata_modefalse
image_typepng
additional_metadata_json

ComfyUI ships two nodes that annoy people by being almost the same: PreviewImage shows you an image without saving, SaveImage saves it to disk. You constantly swap one for the other while iterating. JNodes_SaveImageWithOutput collapses that into a single node with a save_to_output toggle - flip it on when you want to keep the image, off when you're just eyeballing results. The node's own description is blunt: "Saves the input images to your ComfyUI output directory." What it doesn't say is that it also does format choice and metadata control in the same box.

This is a classic quality-of-life move from JNodes, the utility suite Jared Therriault has maintained since 2024. Nothing here is exotic - it's the boring paper-cut fix you appreciate on the hundredth generation.

How it works

Frames come in on the images pin. If save_to_output is true, they're written to your output folder in the format you chose; if false, it behaves like a preview and doesn't persist anything. Either way it passes the images straight back out, so you can keep chaining downstream - a nice touch, since vanilla SaveImage is a dead end.

The inputs and outputs that matter

  • save_to_output (default false) - the reason the node exists. False = preview only; true = write to disk. Note the default is false, which trips people up (see below).
  • image_type (default png) - png, webp, jpg, or bmp.
  • filename_prefix (default ComfyUI) - the leading part of the saved filename.
  • save_prompt_to_meta and metadata_mode (add / replace / discard) - whether and how to embed metadata.

There's also an optional additional_metadata_json input for injecting extra key/values. The output is images (IMAGE), a straight passthrough of what came in.

How to install it

Via ComfyUI Manager: Install Custom Nodes, search "JNodes", install, restart. Or by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/JaredTherriault/ComfyUI-JNodes
pip install -r ComfyUI-JNodes/requirements.txt

then restart ComfyUI. No model downloads.

Common issues & troubleshooting

"It didn't save!" - because save_to_output defaults to false. This is the number-one gotcha. A node with "Save" in the name that defaults to not saving feels wrong, but that's the design: it starts in preview mode so you can wire it in while iterating. Flip save_to_output to true when you actually want the file on disk.

jpg and bmp won't carry the ComfyUI workflow. If you rely on the drag-the-PNG-back-into-Comfy trick to reload a workflow, use png or webp. JPEG stores metadata in EXIF (not the PNG text chunk Comfy reads), and BMP holds essentially nothing. Pick png when the embedded workflow matters; use jpg only when you specifically want smaller, metadata-light files.

metadata_mode: discard strips everything. That's the setting you want when sharing a clean image with no prompt or settings baked in. Conversely, if your metadata isn't showing up, make sure save_prompt_to_meta is on and metadata_mode isn't set to discard.

The passthrough is real - don't double-save. Because it emits images, it's tempting to chain another save after it. If you do, you'll write the file twice. Use the passthrough for further processing, not for a redundant second save node.

Categoryimage

Inputs (7)

NameTypeDefaultDescription
imagesIMAGE
save_to_outputBOOLEANfalse
filename_prefixSTRINGComfyUI
save_prompt_to_metaBOOLEANfalse
metadata_modeCOMBOfalseadd: add additional_metadata_json to the existing extra_pnginfo; replace: replace the existing extra_pnginfo with additional_metadata_json; discard: do not add extra_pnginfo or additional_metadata_json to metadata
image_typeCOMBOpng4 options: png, webp, jpg, bmp
additional_metadata_jsonoptSTRINGOptionally add a secondary set of metadata key-value pairs from a stringified json. Will overwrite keys in extra_pnginfo if a key has the same name.

Outputs (1)

NameTypeDescription
imagesIMAGE