Nodes/CMK Flow/CMK Flow · TriggerWords Concatenate
ComfyUI Node

CMK Flow · TriggerWords Concatenate

Two LoRA Stacks, One Trigger Word String

By CMKFlow·Created 3 months ago·Updated 2 days ago· 6
CMK Flow · TriggerWords Concatenate
    • trigger_words
    ◄trigger_words_1—►
    ◄trigger_words_2—►

    This node does one thing: it takes two strings and returns them joined. That's it. Two inputs, one output, twenty-three lines of Python. If the size of it makes you suspicious, you probably haven't yet tried to feed two LoRA stackers into a single trigger-word toggle.

    The problem it solves

    Trigger words are the rare tokens a LoRA was trained on - ch9ractername, ohwx, whatever the trainer picked - and they only do anything if they reach the prompt. With willmiao's LoRA Manager, that plumbing already exists: a Lora Stacker node outputs a trigger_words string alongside the stack, and a TriggerWord Toggle lets you flip individual words on and off before they head into the prompt.

    Fine with one stacker. Now you want two - a character stack and a slider stack, which is exactly what CMK's shipped LoRA Stack · ZIT subgraph does with two Lora Stacker (LoraManager) nodes. Two stackers means two trigger_words strings, and the toggle has one input. You need a merge, and "merge" here means string concatenation with sane empty handling.

    That's what this node is for. In the shipped subgraph it sits collapsed between the two stackers and the toggle, with only its first input wired - a hint about how often the second is actually needed.

    How it joins

    Feed trigger_words_1 and trigger_words_2 and you get trigger_words back. The logic is deliberately forgiving: if either input is empty you get the other one unchanged, not a dangling separator, so a half-wired node behaves like a pass-through. With both populated you get first,, second - note the doubled comma. That's not a typo in this article or in the source. It's a visible fence between the two groups, so when the merged string lands in your prompt you can see where one stack's words end and the next begins. CLIP doesn't assign any meaning to commas beyond tokenisation, so the fence costs you nothing; the only case it bites is if you pipe the result into something that splits on commas, where you'll get an empty token out of it.

    There are only two inputs, so three or more stacks means chaining nodes, and chaining produces nested fences - one,, two, three,, four. That exact output is asserted in the pack's own tests, so it's intended, not incidental.

    The one gotcha nobody expects

    Both inputs are forceInput sockets, not text fields. You cannot type a trigger word into this node, and dragging it onto an empty canvas gives you a small node with two sockets and nothing to fill in. That's the design - it exists to carry strings from somewhere else to somewhere else. If you want to hand-write words, use CMK Positive / Negative Text from the same pack instead.

    Output is a single STRING named trigger_words, which wires into a TriggerWord Toggle (LoraManager), one of CMK's LoRA pack pipes (CMK LoRA ZIT Pack -Pipe- / CMK LoRA SDXL Pack -Pipe-), or a prompt-concatenate node. Nothing else.

    Install

    Part of the CMK Flow pack, so: ComfyUI Manager, search CMK Flow, install from CMKFlow, restart. Manually:

    cd /path/to/ComfyUI
    git clone https://github.com/CMKFlow/cmk_nodes.git custom_nodes/cmk_nodes
    python3 custom_nodes/cmk_nodes/scripts/install_cmk_requirements.py
    

    The node itself needs nothing beyond ComfyUI. But the two nodes it's meant to sit between are LoRA Manager's, and the CMK LoRA Stack subgraphs (SDXL, ZIT, Combined) won't run without that pack installed - the README says so plainly, and credits it as the design inspiration for CMK's browser. If you load those subgraphs without it, you get missing-node placeholders, not a graceful fallback.

    Troubleshooting

    If the merged output is empty, look at the wires rather than the node: unconnected forceInput sockets are simply empty, and two empties concatenate to an empty string, which then produces a toggle with no words to show. That looks like the node is broken and is really just an unwired graph.

    If someone's words are missing from the final prompt, check which output you grabbed on the stacker - trigger_words and active_loras are adjacent sockets with similar names, and only the first is what you want here.

    And if a LoRA's trigger words are in the string but have no effect, that's not this node. Some LoRAs ship sliders and poses with no trigger word at all, so the string is genuinely empty for them and the conditioning does the work.

    CategoryCMK/Toolbox/Text

    Inputs (2)

    NameTypeDefaultDescription
    trigger_words_1STRING—
    trigger_words_2STRING—

    Outputs (1)

    NameTypeDescription
    trigger_wordsSTRING—