Nodes/Save Image + Prompt TXT (Copy & Reveal)/Save Image Plus (with Prompt TXT)
ComfyUI Node

Save Image Plus (with Prompt TXT)

Save Image Plus (with Prompt TXT)

By Slartibart23·Created 2 months ago·Updated 2 months ago· 0
Save Image Plus (with Prompt TXT)
  • images
    custom_path
    filename_prefixcomfyui
    timestamp
    format
    quality80
    dpi300
    meta_datafalse
    save_workflow_as_jsonfalse
    previewtrue
    prompt_text

    SaveImagePlusPrompt (shown in ComfyUI as "Save Image Plus (with Prompt TXT)") is a standalone save node that does one extra thing over the stock SaveImage: it writes the prompt you generated with as a plain .txt file with exactly the same filename as the image, sitting right next to it. Save comfyui_0007.jpg, get comfyui_0007.txt with your prompt text inside. That's the whole pitch, and it's a surprisingly useful one once you know why the stock node leaves you hanging.

    The problem it's solving. ComfyUI embeds your entire workflow into a PNG as text chunks, so drag any saved PNG back onto the canvas and the whole graph rebuilds. But that magic dies the moment you save as JPG - JPEG has no PNG text chunks, so the prompt and workflow simply evaporate (see our image-I/O notes: anything that re-encodes the image strips the metadata). JPG is what you actually want for sharing, posting, or keeping disk usage sane, and that's exactly where you lose the recipe. The author of this pack (a German fork/port of LayerUtility: SaveImagePlus V2 from ComfyUI_LayerStyle_Advance) decided the fix is a sidecar file instead of trying to hide a graph in EXIF. It's a nod to the AUTOMATIC1111 era, where the prompt lived as a flat string next to the image, not buried in a PNG.

    What you actually set

    The node is an output node (is_output_node), so it always runs and the graph caches backward from it - same as SaveImage. The few inputs that matter:

    • images - wire your final image here, like any save node.
    • prompt_text (optional) - the text that goes into the .txt. It's a forceInput string, meaning it's meant to be wired, not typed. The README's trick: right-click your CLIP Text Encode node → Convert widget to inputtext, then wire that same socket to both the encoder and this node. One prompt, one source of truth.
    • format - jpg or png, with quality (10–100, default 80) and dpi (72–1200, default 300). JPG is auto-converted from RGBA to RGB.
    • filename_prefix (default comfyui) - supports subfolders (projekt/bild) and the %date / %time tokens. timestamp adds None / second / millisecond precision so runs don't collide.
    • custom_path - a literal path to save outside the default output/ folder; leave blank for the normal ComfyUI output dir.
    • meta_data - embed the workflow in the PNG (PNG only, of course). save_workflow_as_json writes a .json sidecar of the graph too.
    • preview - default on; shows the result in the UI. If you save outside the output folder it drops a temp preview copy so the thumbnail still works.

    One behavior worth knowing: it scans the target folder for existing <prefix>_<number> images and continues the highest counter, preserving digit width (_00435_00436). Deliberately, it ignores .txt and .json files when counting - so a missing sidecar never throws your numbering off, and an existing .txt is just overwritten stubbornly with the current prompt.

    Installing

    Two options, both quick - and there's no requirements.txt and no extra packages, which is blessedly rare for a custom node. Via ComfyUI Manager, search "ComfyUI_SaveImagePlusPrompt". Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Slartibart23/ComfyUI_SaveImagePlusPrompt.git
    

    Then restart ComfyUI. It'll appear under the image category.

    Gotchas

    The biggest one: the .txt only gets written if prompt_text is actually wired with non-empty text. Leave it unconnected and you've built a fancier SaveImage with extra steps. The prompt is not pulled from the embedded workflow automatically - wire it.

    Second: since this is a fork of LayerStyle's node, if you already run ComfyUI_LayerStyle_Advance you have a near-identical LayerUtility: SaveImagePlus V2 installed. No conflict - different class names - but you don't strictly need both.

    And remember the sidecar is only as good as its upkeep: it captures the prompt string, not the seed or settings. If you want full reproducibility, keep PNGs with meta_data on; use this node when you want small, shareable JPGs that don't forget what you asked for.

    Categoryimage

    Inputs (11)

    NameTypeDefaultDescription
    imagesIMAGE
    custom_pathSTRING
    filename_prefixSTRINGcomfyui
    timestampCOMBO3 options: None, second, millisecond
    formatCOMBO2 options: jpg, png
    qualityINT8010–100
    dpiINT30072–1200
    meta_dataBOOLEANfalse
    save_workflow_as_jsonBOOLEANfalse
    previewBOOLEANtrue
    prompt_textoptSTRING

    Outputs (0)

    No outputs