ComfyUI Node

Y7 Save Image

Subfolders, a real 16-bit PNG, and a preview switch

By yushan777·Created 2 years ago·Updated 5 days ago· 8
Y7 Save Image
  • images
  • images
◄save_or_previewtrue►
◄sub_folderfoldername/%date:yyyy-MM-dd%►
◄filename_prefiximg_%date:hhmmss%►
◄counter_digits4►
◄counter_per_foldertrue►
◄bit_depth8-bit►

The stock Save Image node is fine until the day you want your renders in a folder that isn't output/'s root, or a 16-bit PNG you can grade later, or you just want to look at a result without a hundred throwaway PNGs piling up in your output directory. Y7 Save Image does all three, and it does the first two without changing how the file behaves when you drag it back onto the canvas.

Why this matters more than it sounds

In ComfyUI the PNG is the project file, not a screenshot of one. SaveImage writes the full node graph and the executed prompt into the file as PNG text chunks, which is why dragging an old render back into the canvas rebuilds the workflow that made it - it's literally how the official example workflows are distributed. The usual beginner injury is the other node: iterating under PreviewImage, which writes to temp/ (a directory ComfyUI clears on restart), and only noticing after a restart.

This node puts both behind one switch. save_or_preview on save (the default) writes to output/ exactly like the native node, metadata and all. On preview it behaves like Preview Image: shown on the node, files go to temp/, and every setting below it is ignored. That's a genuinely nice bit of ergonomics - you swap one toggle instead of rewiring which save node you're using.

The bits you actually set

  • images - the images to save, obviously.
  • save_or_preview (BOOLEAN, default on = save) - as above.
  • sub_folder (STRING, default foldername/%date:yyyy-MM-dd%) - the folder inside output/, created if missing. Empty means the output root. Leading and trailing slashes are stripped, so /renders means output/renders, not a path somewhere else on your disk.
  • filename_prefix (STRING, default img_%date:hhmmss%) - the templating the native node uses, %date:yyyy-MM-dd% and %Empty Latent Image.width% included, with the extra trick that %Node.widget% also accepts a renamed label: a Float node whose value widget you renamed to denoise answers to %Float.denoise%. Add :N to pin decimals: %Float.value:2% gives 0.80, not 0.8.
  • counter_digits (INT 1–10, default 4) - pads the counter. No trailing underscore, unlike the native node: img_0001.png, not img_00001_.png.
  • counter_per_folder (BOOLEAN, default on) - one counter across the folder regardless of prefix, carrying on from the PNGs already there (including the native node's). Off gives each prefix its own counter.
  • bit_depth (8-bit / 16-bit) - 8-bit matches the native node byte for byte; 16-bit writes a genuine 16-bit PNG at roughly 4–5× the size.

Output is images, passed through unchanged - which means you can chain a save into something else (an image compare, a second save at a different depth) without duplicating the wire.

Install

Manager: Custom Nodes Manager → search Y7 → install → restart. Manually:

cd /path/to/ComfyUI/custom_nodes
git clone https://github.com/yushan777/ComfyUI-Y7Nodes
# activate your venv, then:
pip install -r requirements.txt

The pack's only requirement is color-matcher>=0.5.0, and that's for its Color Match node - this one runs on stock Pillow and numpy. Nodes appear under Y7Nodes/Image.

The 16-bit mode, honestly

Pillow can't write 16-bit RGB, so this node assembles the PNG by hand: IHDR, Paeth-filtered rows, zlib at the same compression level as core, and the same prompt / workflow text chunks written before the image data. It scales the float tensor by 65535 instead of 255, so the finer tonal steps the image actually carries survive into the file.

Whether you want that depends on what happens next. Generated images are smooth gradients in exactly the places 8-bit banding shows up - skies, backdrops, skin falloff - and the extra depth pays off if you're going to upscale, grade or composite the PNG afterwards. It does not pay off if the file goes straight to a website, where it gets downconverted anyway. And be clear about what this isn't: it writes the same prompt / workflow chunks as the native node and no A1111-style parameters block, so if CivitAI model auto-linking on upload matters to you, that's still a different node.

Gotchas worth knowing before you file a bug

The default sub_folder puts everything in a folder per day: output/foldername/2026-09-23/img_140507_0001.png. That's pleasant right up until you go looking in output/ for today's images and find nothing - check inside the date folder first.

Date tokens have rules. A dot inside %date:...% breaks it, because the dot is how %Node.widget% references are split - %date:yyyy.MM.dd% comes out as just the year. Use - or _, or put the dot outside the token. Colons in times (hh:mm) are invalid in Windows filenames. And %date:...% is normally filled in by the browser when you queue, which means an API-exported workflow bakes in the export date; this node is nicer than stock here, filling in any unreplaced %date:...% on the server at save time, so scripted runs get the real date. %Node.widget% tokens have no such fallback.

Finally, with counter_per_folder on, numbering carries on from the highest counter already in the folder, so in a folder you've used for a while the new files won't start at 0001. That's the point, but it surprises people who expect a fresh run to reset.

CategoryY7Nodes/Image

Inputs (7)

NameTypeDefaultDescription
imagesIMAGEThe images to save.
save_or_previewBOOLEANtruesave: write the images to the output directory. preview: only show them on the node, like Preview Image; they go to the temp directory, which ComfyUI clears on restart, and the settings below are ignored.
sub_folderSTRINGfoldername/%date:yyyy-MM-dd%The folder inside the output directory to save to, created if it doesn't exist. Leave empty to save to the output directory itself. Accepts the same formatting as filename_prefix.
filename_prefixSTRINGimg_%date:hhmmss%The 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.
counter_digitsINT41–10How many digits the counter at the end of the file name is padded to, e.g. 4 gives img_0001.png.
counter_per_folderBOOLEANtrueOn: one counter shared by every image in the folder, whatever its prefix. Off: a separate counter for each prefix, as in the native Save Image.
bit_depthCOMBO8-bit8-bit matches the native Save Image. 16-bit keeps the finer tonal steps the image carries, at roughly 4-5x the file size.

Outputs (1)

NameTypeDescription
imagesIMAGE—