XB-llama - ๐ฌ ่ง่ฒๅบๆฏ่ฐๅบฆๅจ
Turn one storyboard script into per-scene prompts plus matching characters
- text_input
- ๆ็คบ่ฏ
- ่ๆฏๅพ
- ่ง่ฒ01
- ่ง่ฒ02
- ่ง่ฒ03
- ่ง่ฒ04
Short-drama generation has a coordination problem: you've got a storyboard script where scene 3 needs ่ง่ฒA (character A) against ่ๆฏB (background B), and your graph has separate character images and background images that must pair up with the right prompt, frame by frame. XB_RoleSceneDispatcher is the node that does the pairing. Give it the script text and the available character/background images, and it dispatches aligned lists - one prompt, one background, up to four characters per frame - so every downstream scene gets exactly its cast.
It lives in the pack's XB-llama family and is designed to sit after an LLM that wrote the storyboard: feed it the output of a llama/storyboard node (the text_input accepts any type via a forced input), and it parses the frame structure out of the text.
The parsing contract (the part to get right)
The dispatcher reads a specific format from the text: frames marked ๅ้ๅพ_01 (or Scene_1) and, inside each frame, labels like ่ๆฏA and ่ง่ฒB. Those labels are what it matches against your wired-up images. The optional image inputs are flexible - you connect them by name, e.g. an image port labeled ่ๆฏA or ่ง่ฒC. So the workflow is: script โ dispatcher โ it pulls each frame's ่ๆฏ/่ง่ฒ label, grabs the matching wired image, and emits that frame's prompt + images as one row in the output lists.
Inputs and the "gacha" mode
- text_input - the storyboard script.
- draw_mode - the interesting one. Turn it on and the dispatcher caches the parsed frames on its first run, so later runs can re-dispatch from cache without feeding the text again - the pack calls this ๆฝๅก (gacha) mode. Useful when you're iterating on images while the script stays fixed.
- draw_range - "ๅ
จ้จ" (all) or a specific
ๅ้ๅพ_01โๅ้ๅพ_16to emit just one frame.
Outputs: ๆ็คบ่ฏ (prompts, STRING list), ่ๆฏๅพ (backgrounds, IMAGE list), and ่ง่ฒ01โ่ง่ฒ04 (character images, IMAGE lists). They're list-aligned - element N of each list is frame N's full package, ready to feed a per-frame image-to-video or scene renderer. Missing labels get a black placeholder rather than a crash, which is forgiving but worth knowing: a frame that references a character you didn't wire up will happily produce a black rectangle.
The honest notes
It's a string-and-socket router, not magic - the matching only works if your script uses the ่ๆฏX/่ง่ฒX label vocabulary and you label your image inputs to match. And because it's in the XB-llama family, some users assume it needs a local LLM running; it doesn't - it's pure parsing, and it works with text from any source. It also has no real dependency on llama-cpp-python (which the pack gates behind a try/except), so it's available even on installs where the llama nodes didn't register.
Install: Manager โ XB_ToolBox, or git clone https://github.com/wjluoxiao/XB_ToolBox.git into custom_nodes, restart. Under "XB-llama". No extra pip deps for this node itself.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| text_input | * | โ | |
| draw_mode | BOOLEAN | false | โ |
| draw_range | COMBO | ๅ จ้จ | 17 options: ๅ จ้จ, ๅ้ๅพ_01, ๅ้ๅพ_02, ๅ้ๅพ_03, ๅ้ๅพ_04, ๅ้ๅพ_05, +11 |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| ๆ็คบ่ฏ | STRING | โ |
| ่ๆฏๅพ | IMAGE | โ |
| ่ง่ฒ01 | IMAGE | โ |
| ่ง่ฒ02 | IMAGE | โ |
| ่ง่ฒ03 | IMAGE | โ |
| ่ง่ฒ04 | IMAGE | โ |