TK 字符串路由器
Six text sources, flip between them without rewiring
- text
You're iterating on a prompt. Version A is the safe one, B is the experiment, C is what you paste from Civitai, and you keep swapping the wire into your text encoder like it's 1998 and you're changing a printer cable.
TK 字符串路由器 is a switch instead. Six string inputs, one output, and a node UI that decides which of them get through - no re-plugging. It's one of the utility nodes in TK Toolkit (anima-toolkit by 时运tk), and it's the pack's answer to the same problem every ComfyUI plumbing pack solves: repetition and illegibility.
How it works
The node declares six optional STRING inputs, string_1 through string_6. All six are forceInput sockets, so they're real wires - you can't type into them, you connect text nodes to them.
The separator widget (逗号 , / 空格 / 换行 / 无) decides how the surviving channels are glued together. In comma mode it also collapses consecutive commas and strips leading/trailing ones, same as the pack's text-join node - which matters when your upstream strings already end in a comma.
Your selection lives in a hidden router_settings JSON that travels with the workflow, so it survives save, reload and sharing. In single mode, the row you picked is stored by input number, which is why reordering rows later doesn't quietly change which channel is live. In multi mode, every row with its switch on gets emitted, in the order shown - drag the ⠿ handle on the left of a row to reorder, and the output order follows. Only enabled rows are emitted; disabled ones don't contribute an empty slot.
The other nice touch is labelling. Each row shows the source node's title and output name - TK Text Join · text, for example - detected from the actual connection. By default it prefers the custom title you gave the node on the canvas; switch the 名称 dropdown to use the original node name, or type your own alias so the row reads negative instead of String Literal · STRING.
The output
One output: text, type STRING. It goes where any prompt string goes - a CLIP text encode, or into TK 文本合并 if it's one ingredient among several.
When you'd actually use it
The obvious case is prompt A/B. Keep three or four prompt blocks wired in, flip a row on the node instead of destroying a connection. It costs you nothing at runtime and it stops you from accidentally leaving the wrong text node live after a test.
The less obvious case is one-sink-many-sources: your negative prompt is worst quality, low quality on most runs, but one character LoRA needs a specific exclusion. Put both in, and the node becomes the toggle.
And the case it's genuinely good at: reordering. Prompt order is not cosmetic on modern models - on Anima the word order is what binds an attribute to a subject, because the old CLIP-era attention syntax is inert. If you need your character block before your style block, dragging a row is faster and less error-prone than rewiring four nodes.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/Ararararararaki/comfyui-anima-toolkit
# restart ComfyUI - Python node schema changes require it
Or install through ComfyUI Manager by searching TK Toolkit (registry id anima-toolkit). The pack's only hard dependencies are aiohttp and requests; the web panel ships prebuilt so you don't need Node.js. Find the node under TK/text.
Gotchas worth knowing
An enabled but unwired row contributes nothing, silently. That's the designed behaviour - blank parts are skipped - but it means a "why is my output empty" question usually answers itself by looking at whether the wire is actually connected. All six inputs are optional on purpose so you don't have to fill ports you don't use.
Single mode + a disabled selected row = empty string. In single mode the node emits the selected channel only if that channel's switch is on. Nothing warns you at queue time; you just get no prompt.
It's strings, one at a time. No list handling, no conditional logic, no type coercion. If you're routing anything that isn't text - images, latents, models - reach for a typed switch or the pack's own TK 图像选择 for the image case.
Frontend-only changes need a refresh, not a restart. If you update the pack and the new UI behaviour doesn't show up, hard-refresh the browser (Ctrl + Shift + R) before you start wondering whether the clone worked. Only Python changes need the ComfyUI restart.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| separator | COMBO | 逗号 , | 4 options: 逗号 ,, 空格, 换行, 无 |
| string_1opt | STRING | — | |
| string_2opt | STRING | — | |
| string_3opt | STRING | — | |
| string_4opt | STRING | — | |
| string_5opt | STRING | — | |
| string_6opt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |