Nodes/ComfyUI-ZhiHui/🪣 智绘_高级图像保存
ComfyUI Node

🪣 智绘_高级图像保存

Save anywhere, with numbering that never collides and metadata you control

By zhuyungen·Created 8 months ago·Updated 3 months ago· 0
🪣 智绘_高级图像保存
  • images
  • image
  • full_path
root_pathC:/ComfyUI_Output
sub_folderdate/job1
filename_prefixImage
extensionpng
quality100
dpi300
save_workflow_metadatatrue

ComfyUI's default SaveImage is fine until you want to choose where files land, keep a sensible numbering scheme across interrupted runs, or control whether the workflow is embedded in the file. ZH_SaveImagePlus ("🪣 智绘_高级图像保存") takes over all three: arbitrary root + subfolder, auto-numbering that resumes from the highest existing file (no collisions after a crash), and a metadata switch for when you'd rather share a clean PNG.

It's from ComfyUI-ZhiHui, a Chinese-language utility pack. The filename-heritage trick is its best party piece: pair it with the pack's ZH_LoadImagePlus, which hands you the source filename, and your output keeps the input's name end to end.

How it works

You give it a root_path and sub_folder, and it writes to root_path/sub_folder (creating directories as needed). Naming uses filename_prefix plus a five-digit counter: Image_00001.png. The counter is the interesting bit - before saving, it scans the destination folder for existing files matching your prefix, finds the largest number, and starts one above it. So a run that died at Image_00042 resumes at Image_00043 instead of overwriting. Within a single batch, each frame gets a sequential number on top of that, so no two frames in one run collide either.

Then the format knobs:

  • extension - png or jpg.
  • quality - JPG quality 1–100 (ignored for PNG, which is lossless).
  • dpi - 72–600, baked into the file's DPI metadata (300 default - print-oriented).
  • save_workflow_metadata - the one worth caring about. On, and PNG saves embed the full prompt and workflow chunks, exactly like core SaveImage, so the image reconstructs its own graph when you drag it back in. Off, and you get a metadata-free PNG - useful when sharing, since per image-io-metadata.md, the embedded workflow is your project file and you may not want it traveling.

JPG always drops metadata and flattens alpha to RGB (JPG can't carry either).

The inputs and outputs that matter

  • images - the batch to save.
  • root_path, sub_folder, filename_prefix - where and what to call it.
  • extension, quality, dpi, save_workflow_metadata - the format controls.

Outputs: image (the input passed through untouched, so you can chain saves) and full_path (STRING - the actual file path(s) written, which is surprisingly handy for downstream tooling).

Install

cd ComfyUI/custom_nodes
git clone https://github.com/zhuyungen/ComfyUI-ZhiHui.git

Restart ComfyUI. Base deps only, no models. ComfyUI Manager search "ComfyUI-ZhiHui" also works.

Where people get burned

The default root_path is C:/ComfyUI_Output - a Windows path that won't exist on macOS or Linux, and the node only creates subfolders, not the root. On a non-Windows box you must change this to something real or every save silently fails (it returns an empty path string when the directory can't be created). Second, the numbering scan is prefix-based and extension-aware, so switching extensions mid-project restarts the count for that extension - Image_00001.jpg and Image_00001.png can coexist. And if you're comparing against core SaveImage: this writes to your chosen root, not ComfyUI/output/, so don't go looking for the files in the usual place.

Category智绘灵箱/图片

Inputs (8)

NameTypeDefaultDescription
imagesIMAGE
root_pathSTRINGC:/ComfyUI_Output
sub_folderSTRINGdate/job1
filename_prefixSTRINGImage
extensionCOMBOpng2 options: png, jpg
qualityINT1001–100
dpiINT30072–600
save_workflow_metadataBOOLEANtrue

Outputs (2)

NameTypeDescription
imageIMAGE
full_pathSTRING