XB-llama - ๐๏ธ ๅ้่ฏๅค็ๅจ
Draw cards from your storyboard, one shot at a time
- text_input
- output_list
If you've ever run an LLM storyboard workflow you know the problem: the model hands you a single wall of text with a dozen shots in it, and you want to generate one of those shots without re-encoding the whole thing. XB_llamaStoryboardProcessor is the little slot machine in the middle of the XB-llama chain that splits that wall of text into cards and lets you draw from the deck.
It's part of the XB_ToolBox "XB-llama" family, which is a llama-cpp-python reimplementation of the ComfyUI-llama-cpp_vlm nodes with extra AMD/ROCm handling. The processor sits downstream of the storyboard writer - feed it the multi-line output where every shot starts with ๅ้ๅพ_01, ๅ้ๅพ_02, or Scene_1 - and it caches those lines, then hands you a single list you can wire into your text encoder.
How it works
The mechanism is simpler than the Chinese UI suggests. It regex-matches each line for a ๅ้ๅพ_\d+ or Scene_\d+ header and stashes the whole text in a class-level cache. Then it has two personalities:
- draw_mode off (default): it's a pass-through. It strips blank lines and emits every line as a list item, so you get a clean per-shot list.
- draw_mode on: this is the "ๆฝๅก" (draw/gacha) mode. It ignores new upstream input and serves from the cache instead, letting
draw_rangepick which shot to output -ๅ จ้จfor everything, or a singleๅ้ๅพ_01throughๅ้ๅพ_16.
That cache trick is the whole point. Because the upstream LLM gets skipped in draw mode, you can generate shot 7 twelve times, tweaking the seed, without the language model ever running again. Wire the processor's output to your CLIP/text encoder (or straight into a video i2v node that takes a prompt), and each shot prompt becomes its own generation.
The inputs that matter
Only three, and only two of them will ever bite you:
draw_mode(BOOLEAN) - the off/on switch for gacha mode.draw_range(enum:ๅ จ้จ+ๅ้ๅพ_01โฆๅ้ๅพ_16) - which shot to draw.text_input(optional, any type) - the storyboard text from upstream. Marked optional because the whole design assumes it can go dark while the cache serves.
Output is output_list, a list of STRINGs. In normal mode each line is one item; in draw mode it's the shot (or shots) you picked. If draw mode can't find the requested shot in the cache, it doesn't error - it emits a placeholder prompt that just renders a solid-color image with "ๆชๆพๅฐๅ้ๅพ_XX" text on it. Confusing the first time you see it, actually helpful once you realize it's telling you the header name doesn't exist in your text.
Install
The pack itself:
cd ComfyUI/custom_nodes
git clone https://github.com/WJLUOXIAO/XB_ToolBox.git
# or: ComfyUI Manager โ search "XB_ToolBox" โ install
The README swears there are zero pip dependencies, and for the core pack that's mostly true. But the whole XB-llama family only loads when llama-cpp-python is installed - without it these nodes don't appear in your node list at all. Install it built for your backend:
pip install llama-cpp-python
On an AMD card you want the ROCm/HIP (or Vulkan fallback for older cards) build; the nodes auto-detect which GPU family they're on.
Common issues
- Node missing entirely - llama-cpp-python isn't installed, or the module import failed. Check your ComfyUI console for a line like
[XB-llama] llama-cpp-python ๆชๅฎ่ฃ. - Draw mode says "ๆๆ ็ผๅญ" (no cache) - you ran it with draw mode on before ever running it in pass-through mode. Run once with draw_mode off so it can cache, then flip the switch.
- The "ๆชๆพๅฐ" placeholder image - your cached text uses a different header name than the range you picked (e.g.
Scene_1vsๅ้ๅพ_01). The regex accepts both, but the dropdown only knowsๅ้ๅพ_01-style names, so check which one your writer actually emitted.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| draw_mode | BOOLEAN | false | โ |
| draw_range | COMBO | ๅ จ้จ | 17 options: ๅ จ้จ, ๅ้ๅพ_01, ๅ้ๅพ_02, ๅ้ๅพ_03, ๅ้ๅพ_04, ๅ้ๅพ_05, +11 |
| text_inputopt | * | โ |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| output_list | STRING | โ |