CMK Save Project Text
The 40-line node that keeps your prompt next to the picture
- text_path
CMK Save Project Text does one thing: you give it a path and some text, it writes a .txt file next to that path and gives you the path back. That's the entire node. It's the smallest thing in the pack and it's the one that stops you losing which prompt made a picture.
What it's for
The intended pairing is with CMK Save Project Image: that node outputs FULLPATH, the exact path of the PNG it just wrote. Plug that into full_path here, type or wire your prompt into text, and you get a prompt file sitting beside the render in the same dated folder. Nothing clever, and it's the difference between a folder of images and a folder you can reproduce from three months later.
Mechanism, honestly
base_path, _ext = os.path.splitext(full_path)
text_path = base_path + ".txt"
That's the substance of it. full_path is a forceInput string, so it has to come off a wire - there's no text box on FULLPATH, deliberately, because a hand-typed path would defeat the purpose. The extension is stripped and replaced with .txt, the containing folder is created if it doesn't exist, and the file is written as UTF-8. The text field is a multiline string defaulting to empty, and there's no validation: an empty text still writes an empty file, which is occasionally useful and more often a sign that something upstream didn't get wired.
Inputs: full_path (STRING, forced input), text (STRING, multiline). Output: text_path (STRING), the path of the file it wrote.
Installing
ComfyUI Manager → search CMK Flow → install the CMKFlow entry → restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/CMKFlow/cmk_nodes.git cmk_nodes
python3 cmk_nodes/scripts/install_cmk_requirements.py
The pack's Python requirements are real - ultralytics, insightface, onnxruntime, nudenet, segment-anything, opencv - but none of them are needed for this node; they install for the detection, face and video engines. If you only want the I-O toolbox nodes, you still get the whole install, which is a fair trade for CMK dependency check: OK never being a surprise later.
The collision you'll hit
CMK Save Project Image already writes a .txt beside every PNG - the rendered LOG pipe, which is CMK's structured record of what every module decided. Point Save Project Text at the same FULLPATH and you'll overwrite that log with your prompt, because both nodes compute the identical <base>.txt name.
Pick one. If you want the decisions ledger, skip this node. If you want the prompt, use it and accept that the log for that image is gone. What you can't do is have both, and the failure is silent - the file is simply replaced. A workaround that works fine in practice is prefixing your text with the prompt and letting the log sidecar carry on separately, since the log is written before this node runs.
Second gotcha, and it's the usual one for anything that writes to disk from a workflow: relative paths are relative to wherever ComfyUI was started, since this node doesn't resolve against ComfyUI's output/ directory the way the save-image node does. If you're feeding it something other than a FULLPATH from a CMK save node, pass an absolute path and save yourself the hunt.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| full_path | STRING | — | |
| text | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| text_path | STRING | — |