Nodes/ComfyUI-ScenePromptViewer/Scene Output Saver
ComfyUI Node

Scene Output Saver

Save batch results under their original filenames — before you lose your mind

By yixuanzona·Created 4 months ago·Updated 2 months ago· 10
Scene Output Saver
  • images
    output_root/tmp/ComfyUI/output
    folder_template{scene}/{date}_{version}
    scenescene
    versionv1
    filename_suffix
    save_prompt_txttrue
    image_formatpng
    jpg_quality95
    prompts
    filenames

    Here's the thing ComfyUI's built-in Save Image doesn't do: keep your filenames. Run a folder of 40 images through a processing pipeline and you get back ComfyUI_00001_, ComfyUI_00002_… which means you get to play "which one was WinterScene" afterward. Scene Output Saver exists to end that game. It's the sink node that pairs with Scene Prompt Viewer: feed it the IMAGE batch, wire in the filenames stream from the viewer, and every file comes out under its original name, sorted into a subfolder you define.

    It's an output node - no sockets out, nothing to wire downstream of it. It's the last stop, and it's built for one specific pairing. If you're processing a single image, the README is blunt about it: the built-in Save Image with a manually typed filename is simpler. Reach for this when you're running a whole folder as a batch.

    How it works

    The contract is simple: the viewer gives you filenames as comma-joined file stems, and this node splits them back apart on the comma. Prompts arrive newline-joined and get split the same way, one per image. If save_prompt_txt is on (it is by default), each image gets a sibling .txt with its prompt - handy when the actual PNG metadata isn't going to survive whatever you do next.

    Three inputs shape where things land:

    • output_root - defaults to ComfyUI's output folder; any absolute path works.
    • folder_template - default {scene}/{date}_{version}. Supports {scene}, {date}, {version}.
    • scene / version - your project name and this run's label. Bump version per run and each iteration gets its own fresh subfolder instead of overwriting the last one.

    There's also filename_suffix (appended before the extension, e.g. _resizeWinterScene_resize.png) and image_format - png, jpg, or webp. The jpg_quality slider only applies to JPEG, by the way; the code ignores it for PNG and WebP.

    The safety rail you'll actually hit

    The node is paranoid in a way that will save you once: if the filenames count doesn't match the image count, it aborts with an error instead of misnaming your files. That almost always means a node between the viewer and this saver changed the batch size - an upscaler that split a batch, a mask node that dropped a frame. When you see that error, it's telling you the truth: don't put image-count-changing nodes between the two. Missing or blank filename slots fall back to image_00X.

    One honest tradeoff: this saves via Pillow directly, so unlike Save Image it does not embed the workflow graph in the PNG. The workflow-in-the-image convention (see the image-io essay in our KB) doesn't apply here - your provenance lives in the optional .txt files instead. If you want drag-back-into-ComfyUI saves, this isn't that node.

    Install

    Same pack as the viewer - ComfyUI Manager, search ScenePromptViewer, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/yixuanzona/ComfyUI-ScenePromptViewer.git
    

    Restart, and it's under image → utils. No extra dependencies, no models.

    Categoryimage/utils

    Inputs (11)

    NameTypeDefaultDescription
    imagesIMAGE
    output_rootSTRING/tmp/ComfyUI/output
    folder_templateSTRING{scene}/{date}_{version}
    sceneSTRINGscene
    versionSTRINGv1
    filename_suffixSTRING
    save_prompt_txtBOOLEANtrue
    image_formatCOMBOpng3 options: png, jpg, webp
    jpg_qualityINT951–100
    promptsoptSTRING
    filenamesoptSTRING

    Outputs (0)

    No outputs