π CYH File | Text File Loader
Keep your prompts in .txt files, not in the node
- editable_text
- status
Long style sheets, character sheets, negative-prompt libraries - some text is too big to live comfortably in a node's text box, and some of it you want to edit in a real editor outside ComfyUI. This node loads a .txt file's contents into ComfyUI on demand, with a button you click, and hands the text to the rest of your graph.
It's part of the Chye ComfyUI Toolset's file category, and it pairs naturally with the pack's Text File Editor if you want a load-then-edit pipeline: CYH File | Text File Loader β CYH File | Text File Editor β KSampler.
How it works
You give it a path, click the trigger button, and it reads the file, puts the contents into the node's editable text box (so you can tweak before using), and emits the text. The details that make it usable in practice:
- Path resolution - if the file isn't found at the literal path, it falls back to ComfyUI's
inputdirectory (both the full path and a bare filename lookup). So dragging a file into the input folder and typing its name usually just works. - Encoding - a dropdown (
utf-8,utf-16,ascii,latin-1). If utf-8 fails, it silently retries with latin-1, which is the classic rescue for files that aren't what they claim. - auto_load - when on, it re-reads the file whenever it changes (checked by modification time), which makes it behave like a live-linked file rather than a one-shot load. For prompts you edit mid-run, this is the feature.
- Status output - a second
STRINGoutput tells you what happened:[SUCCESS]with a character count, or[ERROR]/[WARN]with the reason, keeping the current text when a load fails so you don't lose work.
The text lands in the editable_text output, and the node is marked as an output node, so it also displays in the UI.
The gotchas
The trigger dropdown (Load File / Reload) is mostly cosmetic - the node forces execution every time via a unique-change hash, so it re-reads the file on every run regardless. If you're not seeing fresh content, check auto_load and that you're pointing at the resolved path (watch the console; the node prints where it found the file).
Also note the flow control: the node keeps your last text when a load fails, which is good for not blowing away a prompt - but it means a failed load is easy to miss if you're not reading the status output. Keep an eye on it.
Install
ComfyUI Manager (search "Chye ComfyUI Toolset"), or:
cd ComfyUI/custom_nodes
git clone https://github.com/chyer/Chye-ComfyUI-Toolset
cd Chye-ComfyUI-Toolset
pip install -r requirements.txt
Restart after. Pure-Python node, no per-node dependencies beyond the pack's standard set (scipy/opencv-python install alongside). Zip installs need .git/.cnr-id (Chye-ComfyUI-Toolset) per the README.
Verdict
If your prompts live in files - and they should if they're long - this is the cleanest way to get them into a workflow. The auto-load mode alone makes it worth having if you iterate on prompt files between runs. It's not glamorous, it's just useful.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| file_path | STRING | β | |
| trigger | COMBO | Load File | 2 options: Load File, Reload |
| editable_textopt | STRING | β | |
| encodingopt | COMBO | utf-8 | 4 options: utf-8, utf-16, ascii, latin-1 |
| auto_loadopt | BOOLEAN | false | β |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| editable_text | STRING | β |
| status | STRING | β |