ComfyUI Node

🧹 Clear LoRA Name

Strip <lora:...> tags out of a pasted Civitai prompt

By Light-x02·Created 11 months ago·Updated 9 months ago· 42
🧹 Clear LoRA Name
    • positive_prompt
    • negative_prompt
    enabledtrue
    positive_prompt
    negative_prompt

    Every other image on Civitai ships with a prompt that looks like a cinematic portrait of a warrior <lora:FluxHeroXL:0.8> in a snowy landscape. That <lora:...> tag references a specific LoRA you almost certainly don't have downloaded, and ComfyUI doesn't resolve those tags natively the way Automatic1111 does. Feed one through to your sampler and you get junk tokens or errors, not the picture you were promised.

    Clear LoRA Name is the tiny utility that fixes that. It ships in the same pack as the Civitai Discovery Hub node, and its whole job is to sit between the Hub's prompt outputs and your text encoders, quietly deleting every <lora:...> tag so you keep the descriptive prose and drop the dependency. The workflow stays portable, clean, and reproducible - you can hand it to someone with zero LoRAs installed and it just runs.

    How it works

    It's a regex and nothing more. It matches <\s*lora\s*:[^>]*> case-insensitively - so spaces and odd casing don't fool it - replaces each match with a space, collapses runs of whitespace, cleans stray spaces before punctuation, and trims the result. When you compare the input and output side by side, only the LoRA tag is missing. It's not smart, and it doesn't need to be.

    Inputs and outputs

    • enabled - a boolean, default on. Flip it off and the node becomes a pure pass-through, which is handy when you want to keep a tag for a LoRA you actually do have.
    • positive_prompt / negative_prompt - optional strings; either can be left empty. Connect them to the Hub node's outputs (or any text source).
    • positive_prompt / negative_prompt - outputs, the cleaned versions.

    That's the entire schema: two in, two out, one toggle. There are no weights, no modes, no hidden settings to trip over.

    Installing it

    Same install as the Hub node - they're one pack. Via ComfyUI Manager search for ComfyUI-Civitai-Discovery-Hub, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Light-x02/ComfyUI-Civitai-Discovery-Hub
    

    then restart ComfyUI. Dependencies are just numpy, Pillow, and aiohttp. Like the rest of the pack it's V3-only, so if the node doesn't show up, make sure ComfyUI itself is current.

    Where people get burned

    Know what this node does not strip: anything that isn't a LoRA tag. <embedding:...> tokens and wildcard braces sail right through untouched, because the regex only looks for lora. If you're pasting prompts that mix in embeddings, you'll still want to handle those yourself. And remember it only cleans the two prompt strings - it doesn't touch the image output or the metadata JSON from the Hub, which are separate outputs. Small scoped tool, small scoped job - that's the appeal.

    Category💡Lightx02/utilities

    Inputs (3)

    NameTypeDefaultDescription
    enabledBOOLEANtrueEnable/disable the LoRA tag stripping (pass-through when disabled).
    positive_promptoptSTRINGPositive prompt (optional). Any <lora:...> tags will be removed.
    negative_promptoptSTRINGNegative prompt (optional). Any <lora:...> tags will be removed.

    Outputs (2)

    NameTypeDescription
    positive_promptSTRING
    negative_promptSTRING