XB-BOX - 🧠 Bernini 提示词路由(超级节点)
One dropdown replaces a 30-node Bernini prompt-switching subgraph
- 超级提示词
Bernini - ByteDance's Wan-based video editing model - is driven by an MLLM planner that needs a different system prompt depending on what you're doing: text-to-video, image-to-video, video editing, ads insertion, style transfer. The reference workflows implement this as a hideous frontend contraption: twelve mutually-exclusive toggle switches, an Any Switch, a Fast Muter, a string concatenator - thirty-plus hidden nodes that make the graph crawl and let you accidentally light up two modes at once. XB_BerniniPromptRouter replaces the entire subgraph with a single dropdown.
If you've loaded a Bernini workflow from someone else and wondered why the graph was full of mystery nodes - that's what this kills. It's the "超级节点" (super node) in the pack's name, and it's a genuinely good quality-of-life trade: O(1) dropdown lookup instead of O(N) frontend toggle polling, and no way to misconfigure mutually-exclusive modes.
How it works
Inside is a hardcoded dictionary of twelve modes, each mapping to the exact system-instruction prefix the Bernini planner expects:
- Text-to-image, subject-to-image, image editing, text-to-video, image-to-video, video editing
- Video editing variants: propagation (feature sync), reference-guided, ads insertion, action/position, style/dynamics
- A plain "default mode" (
You are a helpful assistant.)
When you run it, it looks up the prefix for your selected mode, concatenates your prompt after it, and outputs the combined string. The separator matters more than it looks: the pack defaults to adding a space, and its own notes explain why - without a separator an English sentence's period can stick to the first word of the prompt, which trips up T5 word-tokenization. You can switch to a newline, or the raw no-separator original behavior.
The inputs that matter
- mode - the twelve-mode dropdown. This is the whole point of the node.
- prompt - your actual instruction, appended to the system prefix.
- separator -
加空格 (推荐)(space, recommended),加换行符(newline), or无分隔符 (原版)(none, original).
Output: 超级提示词 - a single STRING: system prefix + separator + your prompt. Feed it wherever the Bernini pipeline expects the assembled prompt.
Installing
Part of XB_ToolBox - ComfyUI Manager → XB_ToolBox, or
cd ComfyUI/custom_nodes
git clone https://github.com/WJLUOXIAO/XB_ToolBox.git
restart, no dependencies beyond the pack. Note it produces a plain STRING, so you'll wire it into whatever node in your Bernini setup takes the prompt text (often the llama/router node that feeds the planner).
Common issues
- Wrong mode prefix for your task - the twelve modes cover the documented set, but if you're on a custom Bernini variant you may need the generic
默认模式 (Default). - Prompt concatenation looks glued - that's the separator setting. Space is the safe default; newline helps if your prompt starts with a word that merges into the prefix.
- It outputs text, not conditioning - expected. This node only assembles the string; encoding happens further down your graph.
If you've never touched a Bernini workflow this node is meaningless - but the moment you open one, you'll immediately understand why the author built it. It's not adding capability; it's deleting an eyesore.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| mode | COMBO | 视频编辑 - 参考引导 (Reference) | 选择当前工作模式,自动匹配对应的 AI 系统指令前缀 |
| prompt | STRING | 在此输入你的描述词,将自动拼接在系统指令之后 | |
| separator | COMBO | 加空格 (推荐) | 系统指令与用户提示词之间的分隔方式 |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| 超级提示词 | STRING | — |