Skip to content

Save Text Node (CORE-176)#14102

Open
yousef-rafat wants to merge 4 commits into
Comfy-Org:masterfrom
yousef-rafat:save_text
Open

Save Text Node (CORE-176)#14102
yousef-rafat wants to merge 4 commits into
Comfy-Org:masterfrom
yousef-rafat:save_text

Conversation

@yousef-rafat
Copy link
Copy Markdown
Contributor

New Save Text node for saving io.String outputs
Includes support for .txt, .md, and .json file formats
Screenshot 2026-05-25 170952

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 25, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ba01411a-aaf8-4d17-99af-3349b545853e

📥 Commits

Reviewing files that changed from the base of the PR and between 1b70080 and 3e82da4.

📒 Files selected for processing (1)
  • comfy_extras/nodes_text.py

📝 Walkthrough

Walkthrough

This 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)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Save Text Node (CORE-176)' clearly and concisely summarizes the main change: adding a new Save Text node feature to the codebase.
Description check ✅ Passed The description directly relates to the changeset, explaining the new Save Text node feature and its supported file formats (.txt, .md, .json), with supporting visuals.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@yousef-rafat yousef-rafat changed the title Save text Node Save Text Node May 25, 2026
@alexisrolland alexisrolland changed the title Save Text Node Save Text Node (CORE-176) May 25, 2026
Comment thread comfy_extras/nodes_text.py Outdated
with open(filepath, "w", encoding="utf-8") as f:
f.write(text)

return io.NodeOutput(ui=ui.PreviewText(text))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
            ]
        }
    )

Comment thread comfy_extras/nodes_text.py Outdated
yousef-rafat and others added 2 commits May 29, 2026 21:30
Co-authored-by: Alexis Rolland <alexis@comfy.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants