Nodes/Louis Use/🗃️ Batch Image Saver
ComfyUI Node

🗃️ Batch Image Saver

The batch saver that keeps your filenames — and your workflow, and your sidecars

By LouisLU1997·Created 4 months ago·Updated 2 months ago· 0
🗃️ Batch Image Saver
  • images
    输出文件夹
    文件格式png
    质量100
    嵌入工作流true
    覆盖已有文件true
    原文件名
    text
    json

    Most save nodes make you pick a filename prefix and then every image becomes my_workflow_00001.png, _00002, and so on. Fine if you're generating a stack of fresh images. Useless if you're processing a folder of existing files and you want the result to keep the original name so you can match them back up later.

    That's the niche the 🗃️ Batch Image Saver lives in. It's the natural partner to this pack's Folder Image Loader: you point the loader at a directory, run your pipeline, and feed the loader's filename output into this node's 原文件名 input. Every output image is then saved under its source name - just with the extension swapped. You get dragon_pose_a.pngdragon_pose_a.jpg instead of img_00042.jpg. That one wire turns a batch-processing workflow from a sorting nightmare into something you can actually manage.

    What it saves (and what it saves alongside)

    Three optional things, independently:

    • Images - PNG, JPG, or WebP via the 文件格式 dropdown. The 质量 slider (1–100) only matters for JPG/WebP; PNG ignores it.
    • Text - wire the text input and it writes a same-named .txt next to each image. Wire json and you get a .json sidecar. The tooltips hint where this came from: the json input is meant to be fed from Ideogram4 Text Encode's json_text output, so every image ships with its structured prompt next to it.
    • Workflow metadata - the 嵌入工作流 toggle is on by default, which means your prompt and graph are baked into PNG text chunks just like core Save Image does. Flip it off for client-facing delivery, or when you don't want your workflow leaking out. Note it's PNG-only: JPG and WebP never carry it, so if you save JPG you lose the drag-back-into-ComfyUI property entirely.

    The 覆盖已有文件 toggle decides collisions. On (default) means a same-named file just gets overwritten - which is what you want when you're re-running a batch with the original names connected. Off means it auto-appends _1, _2, … so nothing is ever clobbered.

    The 输出文件夹 accepts an absolute path, or a relative one that resolves against ComfyUI's output directory. Leave images unwired and it'll happily save only the text sidecars - handy when you're turning a folder of prompts into files.

    Installing it

    It's part of the Louis Use pack, so you get all the other nodes here at once:

    cd ComfyUI/custom_nodes
    git clone https://github.com/LouisLU1997/ComfyUI-louis-use Louis_use
    

    Or search "Louis Use" in ComfyUI Manager. Restart ComfyUI after either. No extra Python packages needed - this node runs on the torch/Pillow/numpy that ship with ComfyUI.

    Where people get burned

    • Empty folder path throws. The node raises if 输出文件夹 is blank, and relative paths resolve against the output dir, so batch_out isn't a folder in your home directory.
    • JPEG drops the workflow. If you switch to JPG for size and then wonder why the file won't drag back into ComfyUI, that's the 嵌入工作流 note biting you - it's not a bug, it's the format.
    • Filename sync needs the loader's filename output, not the folder path. The input is a list of strings, one per line. If you're getting img_00001 style names, that wire isn't connected.

    It's a simple node - a folder, a format, an overwrite toggle - but the original-filename sync is the feature that makes it worth hunting down, and nothing else in core does it.

    CategoryLouis_use

    Inputs (9)

    NameTypeDefaultDescription
    输出文件夹STRING
    文件格式COMBOpng3 options: png, jpg, webp
    质量INT1001–100JPG/WEBP 压缩质量(PNG 忽略)
    嵌入工作流BOOLEANtrueTrue = 把 workflow/prompt 写入 PNG 元数据(可拖回 ComfyUI 还原) False = 不写入(成品交付 / 防止工作流泄漏) 仅 PNG 生效,JPG/WEBP 一律不写入
    覆盖已有文件BOOLEANtrueTrue = 同名文件直接覆盖(接原文件名时推荐);False = 自动加 _1 _2 防止覆盖
    imagesoptIMAGE不接时只保存文本文件
    原文件名optSTRING接 Folder Image Loader / Folder Text Loader 的 filename 输出,自动用原文件名命名
    textoptSTRING纯文本内容,与图片同名保存为 .txt 文件
    jsonoptSTRINGJSON 内容,与图片同名保存为 .json 文件(接 Ideogram4 Text Encode 的 json_text 输出)

    Outputs (0)

    No outputs