JZL - 🎬 剧本与镜头处理器
The one-call brain that turns a story into a full H3 shooting script
- llama_model
- parameters
- 剧本输出
- BUS
This is the engine room of the JZL MiniMax pack. JZL - 🎬 剧本与镜头处理器 (Script & Shot Processor) takes a rough story idea and, in a single LLM call, turns it into a complete segmented shooting script for MiniMax H3: N segments, each with its own H3 prompt plus scene, video, and audio dispatch instructions. That's the "one-click 漫剧 (comic-drama) creation" pitch the whole pack is built around, and this node is where the magic happens.
The reason it exists is the blank-page problem: a video pipeline is only as good as the per-segment prompts you feed it, and writing sixteen structured H3 prompts by hand is brutal. Let an LLM do the decomposition - story → shots → prompts - in one pass, then let the rest of the pack route those prompts into the actual generation nodes.
How it works
Pick a backend, feed a story, get a structured document out. The output is the "four-section" format the downstream nodes expect: [SHOT_START] blocks each containing ===H3_PROMPT=== (with a multi-field body like detailed_description), plus ===SCENE_INSTRUCTION===, ===VIDEO_INSTRUCTION===, and ===AUDIO_INSTRUCTION=== dispatch sections. The dispatch instructions are slot lists - 角色:孙悟空, 场景:花果山, 道具:金箍棒 - that the dispatcher nodes later turn into actual reference-image assignments.
The LLM backend is your choice:
- 本地模型 [local] - runs a GGUF model through a
llama-serversubprocess (llama.cpp build b10436) that the pack installs for you. No morellama-cpp-python: process-isolated, runs, exits, and releases VRAM. The README's Qwen-class defaults (up to 256K context, temperature 0.6) are tuned so the model keeps the[SHOT_START]format strict instead of free-associating. - 在线API [api] - wire the
api_configinput from the pack's 🌐 API 设置 node and it reads the saved config automatically.
Inputs that matter
- story_input + story_name - your story text, and the folder name it gets saved under.
- mode - 拆解模式 (Decompose) breaks an existing story into shots; 生成模式 (Generate) writes a story from scratch.
- story_style - 19 genre presets (热血战斗 to 谍战风云), each packing tone, color direction, and rhythm guidance into the system prompt.
- segment_count / segment_duration - 4/6/9/12/16/20/24 segments, each 4–15s. Note the tooltip on the model loader: longer scripts need more context (6 segments ≈ 12K tokens, 56 ≈ 128K), so raise
n_ctx/max_tokensas you scale. - ref_image_intro / ref_video_intro / ref_audio_intro - declare your reference assets in
角色A = 孙悟空style lines. The node only counts elements you declared, which keeps the LLM's invented characters out of the statistical table and the slot map. This is the anti-hallucination trick and it matters. - enable_scene / enable_props / enable_video / enable_audio - which dispatch instructions get emitted. Flip them off to shrink the output.
- preference - camera-language preferences from the pack's 🎯 MiniMax H3 偏好设置 node.
- use_custom_rule + custom_rule_path - replace the built-in segmentation rules by pasting text or pointing at a
.txt/.pyrule file.
Outputs
- 剧本输出 (
STRING) - the full structured script. This is what feeds the ✨ 提示词增强 node and then the 📋 分段处理中心. - BUS (
JZL_H3_BUS) - a hidden side-channel carrying the model/API/preference/style config so downstream nodes silently inherit the same backend. Don't ignore it: the PromptEnhancer needs this wire to know which LLM to reuse.
Install and the one gotcha that bites everyone
Pack install: ComfyUI Manager → search JZL or ComfyUI-JZL-MiniMax-H3, or git clone https://github.com/wjluoxiao/ComfyUI-JZL-MiniMax-H3 into custom_nodes/, restart. You need a recent ComfyUI.
The gotcha: local mode will not work until you install the llama runtime. Run this once from the pack directory:
cd ComfyUI/custom_nodes/ComfyUI-JZL-MiniMax-H3
python install_runtime.py # Windows portable: ..\..\..\python_embeded\python.exe install_runtime.py
--dry-run previews the detection, --list-backends shows what your machine can run. Until the runtime's runtime_config.json exists, local mode fails at model load - it's the single most common reason this node "doesn't work" on a fresh install. And if local generation suddenly returns stale config when you switch from API to local, that's cache: the node intentionally re-runs when you change backend, style, or segment count, so let it regenerate.
Also remember the model you're scripting for: H3's local weights are geofenced by the MiniMax H3 Community License out of the US, EU, UK and South Korea - if that's you, the API path is the one to use.
Inputs (24)
| Name | Type | Default | Description |
|---|---|---|---|
| llm_backend | COMBO | 本地模型 [local] | 2 options: 本地模型 [local], 在线API [api] |
| mode | COMBO | 拆解模式 (Decompose) | 2 options: 拆解模式 (Decompose), 生成模式 (Generate) |
| story_style | COMBO | 热血战斗 | 19 options: 热血战斗, 悬疑推理, 温馨日常, 奇幻冒险, 科幻未来, 古风武侠, +13 |
| use_custom_rule | BOOLEAN | false | 关闭=使用默认分段规则;开启=启用下方自定义规则(粘贴文本 / 填文件路径 / 浏览选文件) |
| story_name | STRING | — | |
| story_input | STRING | — | |
| segment_count | COMBO | 4段 | 7 options: 4段, 6段, 9段, 12段, 16段, 20段, +1 |
| segment_duration | INT | 84–15 | 每段视频时长(秒),强制每段视频长度。与「海螺H3视频参数」的时长联动 |
| prompt_lang | COMBO | 中文 [ZH] | 2 options: 中文 [ZH], 英文 [EN] |
| ref_image_intro | STRING | — | |
| ref_video_intro | STRING | — | |
| ref_audio_intro | STRING | — | |
| enable_scene | BOOLEAN | true | 启用后统计表和分段里才会输出场景分类调度指令 |
| enable_props | BOOLEAN | true | 启用后统计表和分段里才会输出道具分类调度指令 |
| enable_video | BOOLEAN | true | 启用后分段里才会输出参考视频调度指令 |
| enable_audio | BOOLEAN | true | 启用后分段里才会输出参考音频调度指令 |
| seed | INT | 00–18446744073709550000 | 随机种子 改 seed 可生成不同结果;前端可选随机/递增 |
| force_offload | BOOLEAN | false | — |
| save_states | BOOLEAN | false | — |
| llama_modelopt | LLAMACPPMODEL | — | |
| parametersopt | LLAMACPPARAMS | — | |
| api_configopt | STRING | 在线API 模式:从「JZL - 🌐 API 设置」节点连线,自动读取弹窗中保存的配置 | |
| preferenceopt | STRING | 从「JZL - 🎯 MiniMax H3 偏好设置」节点连线 | |
| custom_rule_pathopt | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| 剧本输出 | STRING | — |
| BUS | JZL_H3_BUS | — |