Nodes/ComfyUI_SimpleBridgeNode/LoraTextFile as String
ComfyUI Node

LoraTextFile as String

Your LoRA's trigger words, already in your prompt — no copy-paste

By XchanBik·Created about a year ago·Updated about a year ago· 0
LoraTextFile as String
    • STRING
    lora_name

    Half the LoRAs you download ship with a text file: trigger words, recommended weight, sometimes the training dataset's captioning style. You'd normally open it, copy the trigger words, and paste them into your prompt - every single time you swap LoRAs. LoraTextLoader (shown in the menu as "LoraTextFile as String") automates that. It reads a .txt file from your LoRA folder and hands you its full contents as a string you can wire straight into your prompt.

    How it works: on load, the node scans ComfyUI/models/loras - subfolders included - for any .txt file and lists what it finds in the lora_name dropdown. Pick the file next to your LoRA and on run it opens the file and outputs the whole thing, verbatim. If there are no text files at all (or you pick the None placeholder), it returns an empty string and prints an error to the console rather than crashing your graph. That empty-string fallback is deliberate, and it means a missing file degrades to "no trigger words" instead of killing the run.

    The inputs and output are as simple as ComfyUI gets:

    • lora_name - dropdown of .txt files found under models/loras. Only text files, not the LoRA .safetensors themselves. Put a text file next to your LoRA (or in a subfolder) and it shows up here.
    • Output - one STRING socket with the file's full contents.

    Wire that string into a CLIPTextEncode's text input - usually through a text-concat node if you want it combined with your own prompt - and your trigger words come along automatically whenever you swap LoRAs. Two honest gotchas: the output is the entire file, newlines and all, so a multi-line trigger file injects line breaks into your prompt (usually harmless - the tokenizer treats whitespace as separators - but it can surprise you if the file is formatted oddly). And the file needs to decode cleanly with Python's default encoding; a weirdly-encoded file throws and you get the empty-string fallback.

    Where this fits in the ecosystem: it's a deliberately dumb little node living in a pack that's mostly about the Bridge Store/Load pair. If you're doing serious LoRA work, the rgthree Power Lora Loader already surfaces trigger words in its right-click info dialog and can even pull them from CivitAI - that's the kitchen-sink option. This node is the minimal version: the text sitting next to your LoRA, in your prompt, no hand-copying. For people who keep their notes as .txt alongside the weights (many trainers do - rare-token trigger words are standard practice in the training guides), it's the cheapest way to actually use those files.

    Install via ComfyUI Manager (search "SimpleBridgeNode") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/XchanBik/ComfyUI_SimpleBridgeNode
    

    Then restart ComfyUI. No extra Python dependencies, no model downloads - the pack is stdlib plus ComfyUI's own file-path APIs. One mildly annoying detail: the pack installs a console hook that prints "MINIMAL HOOK" debug lines on every run. Harmless, just noise to ignore while you're staring at the logs.

    If you already keep LoRA notes as text files, this is the smallest thing that puts them to work. If you don't, it'll do nothing until you drop one next to a LoRA - but the moment copy-paste fatigue sets in, you'll know where this node lives.

    CategoryXchanBik/Text

    Inputs (1)

    NameTypeDefaultDescription
    lora_nameCOMBO1 options: None

    Outputs (1)

    NameTypeDescription
    STRINGSTRING