Nodes/ComfyUI-Coziness/Lora Text Extractor
ComfyUI Node

Lora Text Extractor

Take the LoRAs out of your prompt without touching the prompt

By skfoo·Created 3 years ago·Updated 2 years ago· 31
Lora Text Extractor
    • Filtered Text
    • Extracted Loras
    • Lora Stack
    text

    If you've ever pasted an Automatic1111-era prompt into ComfyUI, you know the exact feeling this node is for: the lora tags are sitting right there in the text - <lora:add_detail:0.5> - and ComfyUI just stares at them, because in ComfyUI loras are nodes, not prompt tokens. Lora Text Extractor, from the ComfyUI-Coziness pack, is the bridge. It strips the tags out of any text, gives you the clean prompt on one output and the extracted lora specs on another, and lets the rest of your workflow load them for real.

    Reach for it when your loras live inside text: migrating from webui, pulling from wildcard packs that embed <lora:...> tags inline, or building prompts with text-concatenate blocks where the lora is just another fragment. The community pattern that actually took root is exactly this - feed a text prompt in, split the loras out, load them with the pack's MultiLora Loader, and send the filtered text to CLIP Text Encode. People also use it as a debugger: wire its outputs to a display node and you can see, at a glance, which loras actually made it through your prompt.

    How it works

    It's a regex, and it's honest about being one. A single pattern (<(?:lora|lyco):[^>]+>) finds every lora tag in the input. The matched tags become the Extracted Loras output, joined with newlines; everything else, with the tags deleted, becomes Filtered Text. No parsing of weights, no model awareness, no judgment about whether the lora will even work on your checkpoint. That's by design - it's a text utility, and it means it composes with whatever prompt-generation setup you already have.

    The third output is where it gets clever. Lora Stack is a LORA_STACK - a list of (full_path, model_weight, clip_weight) tuples - built by resolving each extracted tag against your installed loras and parsing its weights. That's the exact format Efficiency Nodes' Efficient Loader expects on its lora_stack input, so if you live in that ecosystem you can skip MultiLora Loader entirely.

    Inputs and outputs

    One input: text, a multiline STRING, default empty. Three outputs:

    • Filtered Text (STRING) - your prompt with lora tags removed. Feed it to CLIP Text Encode.
    • Extracted Loras (STRING) - the tags, one per line. Feed it to MultiLora Loader's text input.
    • Lora Stack (LORA_STACK) - for Efficiency Nodes' Efficient Loader.

    The one step everyone forgets: to connect into nodes that show a text box widget, you have to right-click that node and choose "Convert text to input" first. Otherwise there's no socket to plug into. Do it on both CLIP Text Encode and MultiLora Loader and the workflow just wires together.

    Installing

    Same as the whole pack. In ComfyUI Manager, search ComfyUI-Coziness, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/skfoo/ComfyUI-Coziness.git
    

    Restart ComfyUI. The entire pack is one .py file, no requirements.txt, no models to download, no third-party deps - you can't really break your environment with this one.

    Quirks worth knowing

    It strips tags but not the punctuation around them. Feed it pizza <lora:add_detail:0.5>,<lora:epi_noiseoffset2:1.1>, and Filtered Text comes back as pizza ,, - trailing commas included. The tokenizer shrugs it off and the image is unaffected, so most people just live with it; if it bugs you, run the output through a text concat or a quick prompt-cleaner node.

    The other real gotcha is the Lora Stack output: it resolves names against your loras folder, so a tag referencing a file you don't have errors out there (while Filtered Text and Extracted Loras still return fine). That split personality is actually the feature - it's how you catch a typo in a lora name before you burn a batch. It's a 2024-era node written for the CLIP/SDXL workflow this syntax belongs to, and it has no updates beyond a registry bump, but a regex that strips tags doesn't need to chase model releases. It does exactly one thing, and it does it without any moving parts.

    Categoryutils

    Inputs (1)

    NameTypeDefaultDescription
    textSTRING

    Outputs (3)

    NameTypeDescription
    Filtered TextSTRING
    Extracted LorasSTRING
    Lora StackLORA_STACK