Nodes/ComfyUI-Muye-nodes/保存文件(列表)到本地
ComfyUI Node

保存文件(列表)到本地

Save images and captions anywhere on disk, with smart dedupe

By muyexiuluo·Created about a year ago·Updated 23 days ago· 89
保存文件(列表)到本地
  • 图片
  • 图片名称
  • 文本名称
图片文件名
图片后缀.png
图片保存路径请输入
文本文件名
文本后缀.txt
文本保存路径请输入
附加追加
文本

ComfyUI's stock SaveImage always writes to ComfyUI/output/ with its own naming scheme. SaveFilesToLocal is the escape hatch: it saves images and text to any path you specify, with filenames you control - and it won't silently overwrite your existing files. If you're assembling a training dataset, this is the node that closes the loop.

It's two savers in one, and they mirror each other. On the image side you give it 图片 (an IMAGE batch), a base 图片文件名, a 图片后缀 (default .png), and a 图片保存路径. On the text side you give it 文本 (a STRING list - one entry per caption), a 文本文件名, a 文本后缀 (default .txt), and a 文本保存路径. Run it and every image in the batch lands on disk with its name, and every caption lands alongside. Outputs are the actual saved filenames as lists (图片名称, 文本名称), which you can wire onward as a manifest of what was written.

The clever bit is 附加 - append or overwrite. In 追加 (append, the default), if a file with your chosen name already exists, it auto-suffixes: train_01.png, train_02.png instead of clobbering. That's the behavior you want when you're running repeated passes into the same training folder and don't want to lose a run. In 覆盖 it just overwrites. The filename inputs also accept comma-separated lists, and if your batch is bigger than your name list, it cycles names with numeric suffixes so nothing collides.

Where it shines is the classic training-data pipeline: MuyeFileReader reads a folder → BatchTextReplace fixes the captions → SaveFilesToLocal writes the cleaned pairs back out. The KB's image-I/O doc spends real time on the same-basename .txt sidecar convention every trainer expects - this node hands you the control to write exactly that layout, at arbitrary paths, in append mode so you can iterate without losing data.

Install

ComfyUI Manager → search "muye" → install "ComfyUI-Muye-nodes", restart. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/muyexiuluo/ComfyUI-Muye-nodes
cd ComfyUI-Muye-nodes
pip install -r requirements.txt

then restart. Requires only torch + Pillow. The README's manual block references an older ComfyUI_Muye.git URL; use the -nodes one above. Display name is 保存文件(列表)到本地, labels in Chinese (附加 = append/overwrite, 图片保存路径 = image save path). If the node's missing, check the console for [Muye] Failed to load module.

Common issues

The two obvious ones: the path fields default to the literal string "请输入" (please enter) - leave them and nothing saves, no error. And in 追加 mode, remember that "the same name already exists" is expected and produces a suffixed copy, not an overwrite; if you wanted to replace, switch to 覆盖.

CategoryMuye/文件

Inputs (9)

NameTypeDefaultDescription
图片文件名STRING
图片后缀STRING.png
图片保存路径STRING请输入
文本文件名STRING
文本后缀STRING.txt
文本保存路径STRING请输入
附加COMBO追加2 options: 追加, 覆盖
图片optIMAGE
文本optSTRING

Outputs (2)

NameTypeDescription
图片名称STRING
文本名称STRING