Nodes/ComfyUI_AceNodes/πŸ… Text Load
ComfyUI Node

πŸ… Text Load

Pull a text file into the graph by its full path

By hay86Β·Created 2 years agoΒ·Updated about a year agoΒ· 96
πŸ… Text Load
    • STRING
    β—„file_pathβ–Ί

    Every serious ComfyUI user ends up with a stash of text somewhere - saved prompts, LoRA trigger lists, a dictionary of negative terms. Getting that text into the graph is usually the annoying part, because the built-in file tools are all image-flavored. πŸ… Text Load is the pack's blunt instrument for this: give it an absolute file path, and it reads the whole file as UTF-8 and hands it to you as a STRING. One field, one output, and your file's contents are in the workflow.

    How it works

    The required file_path input is a plain STRING. On execution the node opens that path with open(file_path, 'r', encoding="utf-8") and returns the entire file contents as a single string. That's the whole mechanism, and the simplicity is the point - but it carries real implications:

    • The path is an absolute filesystem path. This isn't a ComfyUI input-folder picker; it won't resolve relative to your input directory, and there's no dropdown of available files.
    • It reads everything. A 10,000-line file comes back as one giant string. If you need it as a list, split it with the pack's πŸ… Text List afterward.
    • UTF-8 only. Files in other encodings will throw or come back garbled.

    Inputs and outputs

    • file_path - STRING, absolute path to the text file.
    • Output: STRING - the file's full contents.

    Where you'd use it

    The natural companion is the pack's πŸ… Text Save, which writes text to ComfyUI's output folder - the pair gives you a save/load round-trip for prompt sets. It's also handy for pulling in a prompt library you maintain outside ComfyUI, or feeding a config file's contents into a text-processing chain. Combined with the GPT chat node, you can load a saved prompt, hand it to the LLM, and pipe the result somewhere new.

    Install

    Part of hay86/ComfyUI_AceNodes:

    cd ComfyUI/custom_nodes
    git clone https://github.com/hay86/ComfyUI_AceNodes
    cd ComfyUI_AceNodes
    pip install -r requirements.txt
    

    Restart ComfyUI and find πŸ… Text Load under Ace Nodes. Manager users search ComfyUI_AceNodes.

    Gotchas

    The big one is the path: no picker, no error message worth reading - a typo or a wrong relative path just fails at execution. Double-check the path is absolute and the file is UTF-8 before you blame anything else. Also note this reads at queue time, so if you edit the file and re-run, you get fresh contents - which is a feature, not a bug. And as always with this pack, the full requirements.txt (rembg, transformers, boto3…) installs even though this node is pure file I/O.

    CategoryAce Nodes

    Inputs (1)

    NameTypeDefaultDescription
    file_pathSTRINGβ€”

    Outputs (1)

    NameTypeDescription
    STRINGSTRINGβ€”