ComfyUI Node

DP Save Image V2

Save images with real filenames, formats, and captions

By DesertPixelAi·Created 2 years ago·Updated about a year ago· 25
DP Save Image V2
  • image
    modeSAVE_IMAGE
    folder_namedp_image_folder
    file_nameimage
    extra_text
    add_size_to_namefalse
    save_captionfalse
    image_formatPNG
    prompt_and_caption_text
    negative_or_other
    format_override

    ComfyUI's built-in Save Image node is fine for casual use and genuinely annoying the moment you need anything beyond it - it writes PNG, names files with a counter, and that's about it. DP Save Image V2 covers the gaps: a real filename you control, a format choice beyond PNG, a folder you name yourself, and - the feature that makes this worth knowing about specifically - an optional caption file saved alongside the image.

    How it works

    folder_name and file_name give you actual control over where things land and what they're called, instead of ComfyUI's default counter-based naming. image_format lets you save PNG, JPG, JPEG, or WEBP directly from this one node, rather than needing a separate converter node for anything but PNG. mode toggles between SAVE_IMAGE (writes to disk) and PREVIEW_ONLY (shows the result without saving) - handy for flipping a save node to a scratch preview while you're iterating, without deleting and re-adding a node.

    The part worth calling out specifically: save_caption. Turn it on and, alongside the image file, the node writes a text caption using whatever you feed into prompt_and_caption_text (and optionally negative_or_other). That's the exact image-plus-matching-text-file pairing that LoRA training tools expect - captioning by hand or with a captioner and keeping a .txt next to each image is still the standard workflow for building a training dataset. If you're generating synthetic training images and want them export-ready for a LoRA trainer without a separate captioning pass afterward, this is the node doing double duty.

    Inputs and outputs

    Required:

    • mode - SAVE_IMAGE (default) or PREVIEW_ONLY.
    • image - what you're saving.
    • folder_name (default dp_image_folder) / file_name (default image) - where it goes and what it's called.
    • extra_text (default empty) - appended to the filename.
    • add_size_to_name (boolean, default off) - append the image dimensions to the filename.
    • save_caption (boolean, default off) - write a matching text caption alongside the image.
    • image_format - PNG (default), JPG, JPEG, or WEBP.

    Optional:

    • prompt_and_caption_text / negative_or_other (default empty) - the caption content, used when save_caption is on.
    • format_override (default empty) - override the chosen format on a per-run basis.

    No data outputs - this is a terminal node (is_output_node: true), it writes to disk and that's the effect.

    Installing it

    ComfyUI Manager: search ComfyUI-Desert-Pixel-Nodes, install, restart. Manual:

    cd ComfyUI/custom_nodes
    git clone https://github.com/DesertPixelAi/ComfyUI-Desert-Pixel-Nodes
    

    Restart ComfyUI - no extra models, just image I/O.

    Where people get tripped up

    PREVIEW_ONLY is easy to leave on by accident after a debugging session and then wonder why a batch you ran produced no files - check mode first if your output folder is emptier than expected.

    add_size_to_name and extra_text both modify the filename, and if you're relying on file_name alone to be exactly reproducible run to run (for matching against an external caption list, say), stacking those options in will change the actual filename on disk - know what's turned on before you build automation around exact filenames.

    And if you turn on save_caption expecting a caption to just appear, remember it's a passthrough, not a generator - this node writes whatever text you feed into prompt_and_caption_text, it doesn't invent a caption from the image. You still need something upstream producing that text, whether that's your own prompt string or a captioning model's output.

    CategoryDP/image

    Inputs (11)

    NameTypeDefaultDescription
    modeCOMBOSAVE_IMAGE2 options: SAVE_IMAGE, PREVIEW_ONLY
    imageIMAGE
    folder_nameSTRINGdp_image_folder
    file_nameSTRINGimage
    extra_textSTRING
    add_size_to_nameBOOLEANfalse
    save_captionBOOLEANfalse
    image_formatCOMBOPNG4 options: PNG, JPG, JPEG, WEBP
    prompt_and_caption_textoptSTRING
    negative_or_otheroptSTRING
    format_overrideoptSTRING

    Outputs (0)

    No outputs