Nodes/ComfyUI/Save Image
ComfyUI Node Runs on cloud

Save Image

The node at the end of every workflow

By Comfy-Org·Created 4 years ago·Updated 25 days ago· 121,575
Save Image
  • images
  • images
filename_prefixComfyUI

Look at the end of almost any shared ComfyUI workflow and you'll find the same two nodes: a KSampler feeding a Save Image. It's the default destination for generated images, the thing that writes your results to disk, and it quietly does two jobs - writing the file and embedding the entire workflow inside it. Most people use it for years without noticing the second one, and that second one is a big part of why ComfyUI culture works the way it does.

What it is

Two inputs, one output. images is the tensor to save. filename_prefix (default ComfyUI) is the start of the filename. That's the whole configuration surface, and it's enough.

The mechanism: it writes a PNG into your output directory (ComfyUI/output/) with the counter scheme every save node shares - your prefix becomes ComfyUI_00001_.png, then _00002_.png, auto-incrementing so nothing is ever overwritten. The images output passes the tensor through untouched, so you can save and keep using the same images on the same branch.

Two features hidden in plain sight:

  • The prefix accepts folder paths and tokens. Type faces/2026 and it creates output/faces/2026_...png. Type %date:yyyy-MM-dd% and the date gets substituted. Type %Empty Latent Image.width% and it pulls the width value straight off another node's widget. This is the trick that makes Save Image a folder-based organizer and a naming automaton - and it's the exact reason the dedicated "save to folder" dataset node got deprecated: Save Image already does it.
  • It embeds the workflow. Save Image writes your full workflow JSON into the PNG's metadata. That's the "drag this image back into ComfyUI and the whole graph reconstructs" trick - the property that made "workflow included" a community norm and turned every output image into a shareable recipe. When you post a PNG made with ComfyUI, you're posting the pipeline, whether you meant to or not.

Where it fits

Save Image is the "keep this" endpoint of the save/preview pair. Preview Image is the ephemeral look-see that writes to temp and vanishes; Save Image is the permanent record that lands in output/ with the workflow baked in. The standard pattern is both on the same branch - preview to look, save to keep. If you want to look but not keep 40 drafts, preview only. If every output matters (training data, batch runs), save only.

Getting it and where it goes wrong

Founding-era node in ComfyUI's nodes.py - it's been there since the start, no install, no model files. The gotchas, in order of how often people hit them:

  1. "Where did my file go?" - ComfyUI/output/, not input/. The counter suffix means a repeat run never clobbers the old file; if you expected overwrite, that's a feature, not a bug.
  2. Prefix pollution. Everyone starts with the default ComfyUI, and two workflows sharing a prefix write into the same numbered sequence. Set a distinctive prefix (or a folder prefix) or your output folder becomes a guessing game.
  3. The embedded workflow is a double-edged sword. It's the sharing magic, but it also means the PNG carries whatever was in your graph - if you'd rather not broadcast your exact pipeline, that's the one thing Save Image won't let you avoid.

Simple, load-bearing, and hiding more power than it advertises - which is a fair description of Save Image, and of a lot of ComfyUI.

Categoryimage

Inputs (2)

NameTypeDefaultDescription
imagesIMAGEThe images to save.
filename_prefixSTRINGComfyUIThe prefix for the file to save. This may include formatting information such as %date:yyyy-MM-dd% or %Empty Latent Image.width% to include values from nodes.

Outputs (1)

NameTypeDescription
imagesIMAGE