Save Text Node (CORE-176)#14102
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR adds SaveTextNode (writes text to .txt/.md/.json, parsing and pretty-printing JSON with a fallback on parse error) and exposes it via TextExtension and comfy_entrypoint. The nodes_text.py module is added to the built-in extras_files list so the extension is loaded during startup. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| with open(filepath, "w", encoding="utf-8") as f: | ||
| f.write(text) | ||
|
|
||
| return io.NodeOutput(ui=ui.PreviewText(text)) |
There was a problem hiding this comment.
We need to actually return enough information to be able to generate an asset based on the file that was generated. Otherwise, this node won't be able to work on Comfy Cloud. It also wouldn't appear correctly on the left side panel (for local or Cloud).
The PreviewText exists exactly for that -- to preview text. It isn't sufficient to actually create an output.
There was a problem hiding this comment.
I have updated the code to include SavedResult in "files". Do you have a specific way in mind for implementing this or for the naming?
return io.NodeOutput(
ui={
"text": (text,),
"files": [
ui.SavedResult(file, subfolder, io.FolderType.output)
]
}
)
Co-authored-by: Alexis Rolland <alexis@comfy.org>
New Save Text node for saving io.String outputs

Includes support for .txt, .md, and .json file formats