XB-BOX - 🎨 K2 风格切换路由(超级节点)
One dropdown instead of ten toggles for your K2 style switch
- 切换Lora
- 激活词
- 提示词
Every K2 workflow that lets you switch art styles does it the same ugly way: a pile of mutually-exclusive toggle switches wired through Fast Muter and an Any Switch, all so that picking one style lights up exactly one LoRA. It works, but every time you click a toggle, the ComfyUI frontend has to walk the hidden subgraph's connection state - and with 20+ hidden nodes doing that dance, your workflow gets sluggish and your graph gets unreadable. XB_K2StyleRouter collapses that whole subgraph into a single node with a dropdown. Pick a style, and out come the LoRA index, the trigger words, and your prompt - all three wires you were hand-aligning before.
It's one of the "super nodes" in the XB_ToolBox Pipeline category, and the design philosophy is right there in the source: a dictionary lookup is O(1), a frontend full of toggles is O(N) render cost every refresh. Same result, none of the drag.
What it outputs
Three outputs, one wire each:
- 切换Lora (INT) - the LoRA slot index for the chosen style (0–9). Wire this into the downstream LoRA switcher's index input.
- 激活词 (STRING) - the style's trigger words, e.g.
monochrome ink wash stylefor the ink-wash preset. These are the English activation phrases the LoRA was trained on. - 提示词 (STRING) - your
prompttext passed through untouched. Nothing clever happens here; it just rides along so you have a single clean wire out.
There are ten styles in the menu - ink wash, stippling, childlike sketch, impasto oil, rainy window, purple retro anime, art-deco watercolor, ethereal motion blur, vintage tarot - plus a 关闭LORA (disable LoRA) option. That last one is the detail to know about: it outputs index 9 with an empty trigger string, so the downstream LoRA node can bypass cleanly rather than applying a stale trigger.
The inputs
Just two:
- style - the dropdown. This is the whole point of the node: one choice, inherently mutually exclusive, no way to accidentally light up three toggles at once.
- prompt - multiline text, passed straight through to the 提示词 output.
Installing it
Standard XB_ToolBox install - ComfyUI Manager search for XB_ToolBox, or:
cd ComfyUI/custom_nodes
git clone https://github.com/WJLUOXIAO/XB_ToolBox.git
then restart. The source is emphatic that this node needs zero third-party dependencies - no rgthree, no easy-use, just ComfyUI core. If your old workflow used rgthree's Fast Muter and Any Switch, this node replaces that whole region without pulling in extra packs.
The honest caveat
You're trading flexibility for tidiness. The old toggle subgraph let you recombine styles and triggers however you wanted; this node hard-codes ten style→index→trigger mappings. If your LoRA pack uses different trigger words than the built-in English phrases, the 激活词 output won't match - you'll want to verify against your actual LoRA's metadata, or just ignore the trigger wire and wire your own text in. And the "K2" in the name is the workflow it was built for: it's aimed at a K2-style pipeline that switches LoRA slots per style. If that's not your pipeline, the index output may mean nothing to your downstream nodes. For the use case it's named for, though, this is the node that makes a clunky subgraph disappear.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| style | COMBO | 单色水墨晕染风格 | 选择风格模式,自动匹配 Lora 索引和激活词 |
| prompt | STRING | 在此输入你的描述词,将原样透传至下游 |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| 切换Lora | INT | — |
| 激活词 | STRING | — |
| 提示词 | STRING | — |