Nodes/ComfyUI_StringOps/文件操作🐠meeeyo.com
ComfyUI Node

文件操作🐠meeeyo.com

Copy or move files from inside a workflow — with a status string instead of a crash

By MeeeyoAI·Created 2 years ago·Updated about a year ago· 209
文件操作🐠meeeyo.com
  • any
  • result
source_path
destination_path
operationcopy

ComfyUI is mostly about images and tensors, but sometimes you want the graph to do filesystem work: after you render, copy the output PNG to a shared folder; or when a batch finishes, move the good files somewhere before they get overwritten. FileCopyCutNode (文件操作 - "file operations") is exactly that - a copy/cut node you drop into a workflow like any other node, with a STRING status output instead of a crash. If the author of the pack added it (2025-06 update note), it's because everyone eventually wants workflows that tidy up after themselves.

How it works

Three inputs: source_path, destination_path, and an operation dropdown with exactly two choices: copy or cut.

  • copy uses shutil.copy2 - the full copy, preserving metadata (timestamps).
  • cut uses shutil.move - the file is moved, not copied.
  • Destination directories are created automatically (os.makedirs(..., exist_ok=True)), so you don't need the target folder to exist first. That's a genuinely nice touch.

If the source file doesn't exist, you get a clean failure message back on the output rather than a workflow-killing exception. Output is a single STRING named result, and it's a status message in Chinese - 执行成功: 文件已复制 ("success: file copied") or 执行失败: ... with the reason. There's an optional any input port that the node doesn't actually use - it's there so the node plugs into arbitrary wiring without a type mismatch. Ignore it.

Why you'd reach for it

Automation and archiving. The classic pattern: render, then copy the output into a dated archive folder, or move an input file out of the way after processing so a batch doesn't reprocess it. Because the status is a string output, you can also wire it into a text display or a log file (WriteToTxtFile from this pack) to keep a run history - the pack clearly envisions those two working together.

Install

Part of ComfyUI_StringOps:

cd ComfyUI/custom_nodes
git clone https://github.com/MeeeyoAI/ComfyUI_StringOps.git

Restart. Or ComfyUI Manager → "ComfyUI_StringOps". No models. UI is Chinese (文件操作) with the 🐠meeeyo.com branding and the author's WeChat ad in the node description.

Common issues

The big ones are the platform ones. Path separators: backslashes in Windows paths are fine, but in a JSON workflow they get escaped, so paste paths carefully. Absolute paths only: the node does no path resolution against ComfyUI's directories - source_path is taken literally, so a bare filename won't magically resolve to your output folder; type the full path or wire it from another node. It copies/moves files, it won't do directories - the check is os.path.isfile, so a folder as source fails cleanly (that's FileDeleteNode's territory for directories, and it works differently). And remember cut = move: on a one-time workflow that's fine, but if the workflow runs again, the source is gone and you'll get the failure status. That's by design - read the status string.

Honest, simple, and it fills a real gap for people who want their pipelines to manage files, not just pixels.

CategoryMeeeyo/File

Inputs (4)

NameTypeDefaultDescription
source_pathSTRING
destination_pathSTRING
operationCOMBOcopy2 options: copy, cut
anyopt*

Outputs (1)

NameTypeDescription
resultSTRING