Load Specific Txt File Tlant
The 'Just Give Me This One File' Text Loader
- text
Sometimes you don't want a random prompt from a folder - you want that file, the one you know by name, and you want its contents wired into the graph. That's the entire job of this node: give it a path to a .txt file and it returns the file's contents as a STRING. It's the deterministic counterpart to the pack's random loaders, and it's useful in all the places where randomness is the enemy: a fixed negative-prompt library, a stable style block you keep in a file, or a config prompt you edit in a text editor instead of inside ComfyUI's widgets.
How it works
There's not much mechanism to get wrong. The single input file_path is checked with os.path.isfile; if it's not a file, the error string is returned as the text output rather than raised (the pack's house style). If the file exists, it's read as UTF-8 and returned. One input, one output: file_path in, text out.
Note the default value is a Windows-style placeholder - C:\path\to\your\file.txt - which is a hint about who the author targets and a subtle reminder to replace it. If you're on Linux or macOS, use forward slashes and a real path.
Install
It's one of the sixteen nodes in the Tlant pack:
cd ComfyUI/custom_nodes
git clone https://github.com/Tlant/ComfyUI-OllamaPromptsGeneratorTlant
restart ComfyUI. Or grab it from ComfyUI Manager ("Load Specific Txt File Tlant"). No extra dependencies beyond requests/aiohttp, which Manager handles.
Where people get tripped up
- Path typos are silent-ish. Because errors come back as the
textoutput, a wrong path means your prompt literally becomes the error text. The console also prints it, so check there if something weird reaches the encoder. - UTF-8 only. Unlike the random loaders in this pack, this node doesn't try
gbkorlatin-1fallbacks - a file saved with a legacy Windows encoding may fail to read. Save your prompt files as UTF-8 and you'll never think about it. - Absolute path expected. Relative paths can work depending on ComfyUI's working directory, but don't rely on it - use a full path.
A trivial node, but a genuinely useful one: version-control your prompts in a folder, reference them by path, and keep the long text out of your graph. When you want one specific file and no surprises, this is the load.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| file_path | STRING | C:\path\to\your\file.txt | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |