Nodes/Comfyui_PDuse/PD_save image path
ComfyUI Node

PD_save image path

Save images anywhere, with the filename format you actually want

By 7BEII·Created 2 years ago·Updated 15 days ago· 53
PD_save image path
  • images
  • success
  • saved_count
filename_prefixR
save_path
formatpng
numberfronttrue
separator_
show_previewtrue
refresh_each_runfalse

ComfyUI's Save Image writes into output/ with a date folder and a counter you mostly can't control. That's fine until you're building a batch pipeline that needs every image in one specific folder, named in a specific pattern - training-data prep, an A/B comparison folder, a "render to a network drive" job. PD_imagesave_path ("PD_save image path") is that node: a Save Image that lets you pick the directory, the prefix, whether the number comes first, and the separator, and then tells you whether it actually saved anything.

It's from 7BEII/Comfyui_PDuse, the PDuse utility pack - one of its several save nodes, and probably the one you'd reach for first.

How it works

Feed it images, and it writes each frame out. The save_path field is flexible: leave it empty and it falls back to output/<prefix>_<date>/ like core; give it a folder and it saves there (creating it if needed); give it a full filename with a .png/.jpg extension and it treats that as the base name. format picks png or jpg - and it matters: PNG keeps alpha and embeds the workflow metadata (same prompt/extra_pnginfo chunks core SaveImage writes), while JPG drops alpha and metadata by definition.

The filename shape is where this node earns its keep. With numberfront on, files come out 1_R.png, 2_R.png - counter, then separator (_), then your filename_prefix. With it off, R_1.png. The counter scans the target directory and picks the next unused number, so re-runs append instead of overwriting. It's the difference between "sorted correctly in a file manager" and "shuffled by your OS," which for a 500-image batch is the difference between usable and a headache.

Two more switches: show_preview (on by default) sends the saved images to the UI like a preview node, and refresh_each_run forces the node to re-execute every run instead of being cached - turn it on when you're iterating and expect new output each pass.

The outputs

  • success - BOOLEAN, true if at least one image was saved.
  • saved_count - INT, how many. Wire these into a text-display node to get a "saved 12 files" report in your workflow; that's the main reason they exist.

Installing

Easiest via ComfyUI Manager (search Comfyui_PDuse), or:

cd ComfyUI/custom_nodes
git clone https://github.com/7BEII/Comfyui_PDuse
cd Comfyui_PDuse
pip install -r requirements.txt

Restart, done. No model files; the heavy new dependency in the pack is scipy.

Gotchas

The README is Chinese, and defaults assume Windows - type your paths, don't copy a screenshot's. One trap worth knowing: like core SaveImage this is an output node, so ComfyUI always runs it, and if you leave refresh_each_run off and nothing downstream changes, it may not re-save on a re-run even though the counter says it should. If you're iterating on the same images and wondering why the folder didn't update, flip refresh_each_run on. Also, JPG can't hold alpha - if your image has transparency and you pick jpg, it silently flattens. Use png for anything with a mask or alpha channel.

CategoryPD/Image

Inputs (8)

NameTypeDefaultDescription
imagesIMAGE
filename_prefixSTRINGR
save_pathSTRING
formatCOMBOpng2 options: png, jpg
numberfrontBOOLEANtrue
separatorSTRING_
show_previewBOOLEANtrue
refresh_each_runBOOLEANfalse

Outputs (2)

NameTypeDescription
successBOOLEAN
saved_countINT