🗃️ Batch Image Saver
The batch saver that keeps your filenames — and your workflow, and your sidecars
- images
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.png → dragon_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
textinput and it writes a same-named.txtnext to each image. Wirejsonand you get a.jsonsidecar. The tooltips hint where this came from: thejsoninput is meant to be fed from Ideogram4 Text Encode'sjson_textoutput, 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, sobatch_outisn'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
filenameoutput, not the folder path. The input is a list of strings, one per line. If you're gettingimg_00001style 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.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| 输出文件夹 | STRING | — | |
| 文件格式 | COMBO | png | 3 options: png, jpg, webp |
| 质量 | INT | 1001–100 | JPG/WEBP 压缩质量(PNG 忽略) |
| 嵌入工作流 | BOOLEAN | true | True = 把 workflow/prompt 写入 PNG 元数据(可拖回 ComfyUI 还原) False = 不写入(成品交付 / 防止工作流泄漏) 仅 PNG 生效,JPG/WEBP 一律不写入 |
| 覆盖已有文件 | BOOLEAN | true | True = 同名文件直接覆盖(接原文件名时推荐);False = 自动加 _1 _2 防止覆盖 |
| imagesopt | IMAGE | 不接时只保存文本文件 | |
| 原文件名opt | STRING | 接 Folder Image Loader / Folder Text Loader 的 filename 输出,自动用原文件名命名 | |
| textopt | STRING | 纯文本内容,与图片同名保存为 .txt 文件 | |
| jsonopt | STRING | JSON 内容,与图片同名保存为 .json 文件(接 Ideogram4 Text Encode 的 json_text 输出) |
Outputs (0)
No outputs