Nodes/ComfyUI-FilterLoRATriggers/Filter LoRA Triggers (block money/prostitution/paths)
ComfyUI Node

Filter LoRA Triggers (block money/prostitution/paths)

The LoRA trigger cleanup that keeps 'money' and 'system32' out of your prompt

By DrkSun81·Created about a month ago·Updated about a month ago· 0
Filter LoRA Triggers (block money/prostitution/paths)
    • filtered_triggers
    trigger_words
    extra_blocklist

    Ever load a workflow that uses a LoRA loader, watch it auto-append every LoRA's trigger words to your prompt, and wonder where "money", "condom" and C:\Windows\system32 came from? That's this node's entire reason to exist. FilterLoRATriggers sits between your LoRA loader and your positive prompt and strips the junk before it ever reaches the sampler.

    It's one of three nodes shipped in ComfyUI-FilterLoRATriggers, a small MIT-licensed pack that DrkSun81 built to support their "master v4 / v4.5 Illustrious" regional NTR workflows. And it exists because of a real, annoying problem: NSFW LoRA packs on Civitai ship trigger metadata that's polluted. Some of it is transaction vocabulary - prostitution, money, sugar daddy, brothel - and some is straight-up filesystem garbage (c:\, system32, .ps1) that looks like it got scraped or concatenated in by accident. Loaders like LoRA Manager and rgthree's Power Lora Loader faithfully inject whatever's in that metadata, and suddenly your prompt reads like a sysadmin's fever dream.

    How it works

    It's pure string processing - no model, no API, no key, no GPU. Under the hood it:

    1. Splits your trigger text on commas, newlines, and semicolons
    2. Normalizes each token: strips whitespace and stray commas, drops the @TriggerName prefix some loaders add, collapses runs of spaces
    3. Dedupes (first occurrence wins)
    4. Kills anything on the built-in blocklist, matched case-insensitively as substrings, plus an exact-match set
    5. Drops tokens containing path garbage and single-character noise
    6. Rejoins what's left with ", "

    The blocklist is right there in filter_lora_triggers.py, so you can read exactly what it considers dirty before you trust it: prostitution, money, cash, dollar, payment, wallet, condom, "sugar daddy", "brothel", "hooker", "escort" - and the Windows path fragments. Adjust the source if your pollution looks different; it's one list.

    The inputs and outputs that matter

    Only two inputs, and a beginner only touches one of them:

    • trigger_words (required, multiline): the blob your LoRA loader produces. It's forceInput, so it expects a wire from the loader, not a typed value.
    • extra_blocklist (optional, multiline): your own comma-separated substrings to drop, case-insensitive. This is the one you'll actually set - the tooltip says it plainly: "Extra comma-separated substrings to drop". If one LoRA in your stack keeps injecting a word the author didn't think of, add it here.

    Output is a single filtered_triggers (STRING). Wire it into whatever concatenates your positive prompt, ahead of the CLIP Text Encode.

    Installing it

    No dependencies beyond what ComfyUI already ships (stdlib plus torch comes along with ComfyUI itself), and no model files to download. The usual two ways work:

    cd ComfyUI/custom_nodes
    git clone https://github.com/DrkSun81/ComfyUI-FilterLoRATriggers.git
    

    then fully restart ComfyUI. Or search "ComfyUI-FilterLoRATriggers" in ComfyUI Manager and let it handle it. You should see [ComfyUI-FilterLoRATriggers] registered: [...] in the console - the pack's loader prints that on purpose so you can confirm it loaded. (Side note: the loader uses importlib rather than normal relative imports precisely because the hyphenated folder name would break from .module - that's why this pack works despite the dash.)

    Where people get burned

    • Substring matching is blunt. The blocklist is case-insensitive substrings, so a word like "cash" will also kill "cashmere" or "cashier". Keep your extra_blocklist entries specific - a whole word, not a syllable - or you'll silently delete triggers you wanted.
    • It sees the combined string, not per-LoRA metadata. If you want to know which LoRA is the polluter, this node won't tell you. It's a fire hose filter; the diagnosis is on you.
    • If your loader doesn't inject triggers, you don't need this node. It's genuinely narrow. The honest take: it's the right tool when you stack Illustrious-family NSFW LoRAs whose metadata is filthy, and dead weight otherwise. That's fine - 40 lines of Python that save you from holding used condom sneaking into a prompt is a good trade.
    Categoryutils/prompt

    Inputs (2)

    NameTypeDefaultDescription
    trigger_wordsSTRING
    extra_blocklistoptSTRINGExtra comma-separated substrings to drop (case-insensitive)

    Outputs (1)

    NameTypeDescription
    filtered_triggersSTRING