Nodes/Comfyui_PDuse/PD:SAVE_PATH_V2
ComfyUI Node

PD:SAVE_PATH_V2

A save node that writes where you want, with the workflow embedded

By 7BEII·Created 2 years ago·Updated 15 days ago· 53
PD:SAVE_PATH_V2
  • images
    nameT
    output_dir
    number_starttrue
    number_padding1
    filename_delimiter_
    extensionjpg
    quality100
    optimize_imagetrue
    lossless_webpfalse
    embed_metadatatrue
    overwrite_modefalse

    ComfyUI's stock Save Image is fine until you need to save somewhere specific - a dataset folder, a subdirectory per run, a name that includes the date or a token. Then you're back to renaming folders by hand. PD:SAVE_PATH_V2 is the pack's answer: a full-featured image save node with custom output paths, time tokens in names, six output formats, quality control, and - the part that actually matters in this ecosystem - it embeds the workflow and prompt metadata into the file, the same way core does. The image stays a project file, just in a folder you chose.

    It slots into the wider ComfyUI truth from the image-IO doc: "the metadata is the payload." A save node that drops you a PNG in D:/datasets/ without the embedded workflow is a footgun; this one defaults embed_metadata to true, so you get the reproducibility you'd expect.

    How it works

    Give it an images tensor plus a name (default "T") and optionally an output_dir. If output_dir is empty it saves to ComfyUI's output folder under a name_YYYY-MM-DD subfolder; if you give a path, it parses tokens in both the name and path, and relative paths resolve under the output directory. Filenames are built as name + optional number + delimiter + extension, with number_start controlling whether the index leads (1_T.jpg) or trails (T_1.jpg) and number_padding controlling width.

    Format-wise it's properly capable: png, jpg, jpeg, webp, bmp, tiff; quality for lossy formats; optimize_image; lossless_webp for WebP; and embed_metadata, which writes the prompt and workflow chunks into PNG files (and EXIF-equivalent fields for JPEG) so dragging the file back into ComfyUI rebuilds the graph.

    The one behavior to flag: overwrite_mode defaults to false, meaning it avoids clobbering. Set it to prefix_as_filename to change what gets used as the filename base.

    The inputs that matter

    • images - the batch to save.
    • name - prefix; supports time tokens (parsed internally).
    • output_dir - custom destination (empty = default output folder).
    • extension, quality, optimize_image, lossless_webp - encode knobs.
    • embed_metadata - keep this true unless you're scrubbing provenance.
    • overwrite_mode - false or prefix_as_filename.

    There are no outputs - it's an output node that just writes files.

    Installing it

    Part of Comfyui_PDuse by 7BEII. ComfyUI Manager (search "PDuse") or:

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

    Restart. Uses Pillow from the pack deps; no model downloads. Chinese-first docs.

    Where people get burned

    Because output_dir is a plain string, a typo silently creates a new folder rather than failing - check where files actually landed. Metadata written to JPEG goes into EXIF, and many sharing platforms strip it on upload, so don't rely on it surviving a re-encode (the image-IO doc's whole warning). And if you switch number_start mid-run you'll change the naming scheme on the same output folder, which can surprise a downstream dataset loader.

    CategoryPD/Image

    Inputs (12)

    NameTypeDefaultDescription
    imagesIMAGE
    nameSTRINGT
    output_dirSTRING
    number_startBOOLEANtrue
    number_paddingINT11–9
    filename_delimiterSTRING_
    extensionCOMBOjpg6 options: png, jpg, jpeg, webp, bmp, tiff
    qualityINT1001–100
    optimize_imageBOOLEANtrue
    lossless_webpBOOLEANfalse
    embed_metadataBOOLEANtrue
    overwrite_modeCOMBOfalse2 options: false, prefix_as_filename

    Outputs (0)

    No outputs