Nodes/Comfyui-General-API-Node/Load Text (FeiMao-326)
ComfyUI Node

Load Text (FeiMao-326)

Pull a character bio or prompt template straight from your input folder

By FeiMao-326·Created 12 months ago·Updated 5 months ago· 0
Load Text (FeiMao-326)
    • text
    filename

    Every ComfyUI user has the same ritual: you've got a long world-building doc, a character bio, or a carefully-crafted prompt template, and you paste it into a text node - again, every single run. This node ends that. It reads any text file from ComfyUI's input folder and hands you the contents as a string, so your context lives in a file you can edit in any text editor, not inside the workflow JSON.

    How it works

    There's a single input, filename, and it's a dropdown - the node scans your input directory on load and lists every file matching .txt, .json, .md, or .csv. Pick one and it reads the whole file (UTF-8) and outputs it as a text string. That's the entire mechanism, and the simplicity is the point: no path typing, no escaping, no file-browser middleware. Drop the file in the folder, refresh the node, pick it from the list.

    Two behaviors worth knowing:

    • The dropdown is populated at startup (when the node's input types are evaluated). Add a new file after ComfyUI is running and it won't appear until you refresh the node or restart - one of those tiny gotchas that costs everyone five minutes once.
    • Missing files fail gracefully. If the file vanishes after the dropdown was built, you get an Error: File '...' not found string in the output rather than a crashed graph. Handy for debugging, annoying if you forget you're reading an error string.

    Where it fits

    The author's use case is the good one: keep a character bio, world-building doc, or long prompt template in the input folder, then inject it into the General API Node with one click - no copy-paste, and the file stays the source of truth that you can edit between runs. Combined with the pack's Save Text, you get a loop: LLM output → saved to file → loaded back into the next run.

    It's also quietly the right tool for any long-form context you don't want bloating your workflow file. A 10k-character lore doc as a widget makes every saved PNG's embedded workflow huge; as a file on disk, it's a two-line node.

    The limitation is that it reads whole files as single strings - there's no line-picking, no per-line iteration. If you need "one of these ten prompts," pair it with Text Split By Delimiter + Get List Element (both in this pack) rather than expecting Load Text to index anything.

    Inputs and outputs

    • filename (dropdown, enum) - the file from input/ to read; .txt, .json, .md, .csv.
    • text (STRING) - the full file contents.

    Installing

    It's part of the FeiMao-326 pack, so it comes with the other fifteen nodes. ComfyUI Manager (search "Comfyui-General-API-Node") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/FeiMao-326/Comfyui-General-API-Node.git
    cd Comfyui-General-API-Node
    pip install -r requirements.txt
    

    Restart ComfyUI, then Add Node → FeiMao-326 → Load Text. Light dependencies (openai, numpy, Pillow, requests), no model files to download.

    CategoryFeiMao-326

    Inputs (1)

    NameTypeDefaultDescription
    filenameCOMBO1 options: (No .txt / .json found in 'input' folder)

    Outputs (1)

    NameTypeDescription
    textSTRING