沐阳 H3 · 分段提示词
Pull one shot's prompt out of the plan — or let the LLM polish just that segment
- prompt
- batch_index
If H3ScriptSplitter is the film editor planning the cuts, H3SegmentPrompt is the guy who hands the camera operator the right page of the script for the shot they're about to take. It takes the splitter's plan_json plus a segment number, and outputs exactly that segment's prompt - the one thing the H3 sampler for that segment actually wants on its CLIP input.
The node has three operating modes, and the choice is really about how much of your prompt budget you spend per shot:
- 全片同一提示词 (whole script, same prompt) - zero tokens, every segment gets the same complete prompt. Fine for scenes that don't change, worthless for an actual story.
- 直接用分段稿 (directly use the segment draft) - just hands out the prompt the splitter embedded in the plan. No LLM call, no cost, exactly what the plan said.
- LLM细化 (LLM refine) - sends only this segment's outline to the LLM and asks it to flesh it out. This is where the per-shot quality lives: the LLM sees one shot's context instead of a whole script, so its rewrite stays on-topic.
Refine mode also honors carry_prev_tail - leave it on and it appends the tail of the previous segment's outline, which keeps actions from teleporting between cuts. That's a quiet but real continuity win; shots hand off into each other instead of starting cold.
The input worth understanding before any other is media_prefix. It's a raw media-reference line prepended, verbatim, to every segment. The tooltip explains the reasoning: models and LLMs keep mangling @视频1-style tags, so this pack keeps them out of the LLM's hands entirely. Put your media reference sentence here rather than in the script. In "whole script" mode, this field is your whole prompt.
Outputs are prompt (STRING, into your H3 conditioning node) and batch_index (INT - handy when you're batching segments through a loop). The one real gotcha: keep segment_index inside the plan's segment count, and remember the plan was computed on a 17k+5 frame grid at 24fps - if your plan says 10 segments, asking for segment 11 gives you nothing. Also note this node does not decide whether the LLM runs at all - that's llm_enabled here, but if no LLM service is configured you'll see the "未配置 LLM 服务" placeholder and it behaves like direct-pass.
Install is the shared pack story: ComfyUI Manager → search ComfyUI-MiniMaxH3-Myang → install → restart (hard-refresh the browser tab if the node list looks stale), or git clone https://github.com/civilcoco/ComfyUI-MiniMaxH3-Myang.git into custom_nodes. No extra Python dependencies; you still need a recent ComfyUI with the official MiniMax H3 nodes and the model weights, which are heavy (~42.5GB reported for full precision) and subject to the H3 Community License's territorial restrictions - worth checking before you commit to the download.
Reach for this node when you're hand-wiring a long-video graph and want per-shot prompt control without re-typing prompts for every segment. In the Director workflow it's handled for you; here, it's the difference between ten shots that look related and ten shots that tell a story.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| plan_json | STRING | — | |
| segment_index | INT | 11–12 | — |
| mode | COMBO | 全片同一提示词 | 3 options: 全片同一提示词, 直接用分段稿, LLM细化 |
| media_prefix | STRING | 参考@视频1中的人物动作表情、镜头调度、画面风格,并将@视频1中的人物完全替换成@图片1,并且背景替换成美丽的大草原。保留素材中已有的版权标识,没有背景音乐,无字幕。 | 每段都原样前置的媒体引用句。放在这里而不是交给 LLM,是因为模型经常把 @视频1 这类标记改写坏。『全片同一提示词』模式下,这里就是全片唯一的提示词。 |
| llm_service | COMBO | 1 options: 未配置 LLM 服务 | |
| carry_prev_tail | BOOLEAN | true | 细化时附上一段梗概的结尾,让动作衔接更稳 |
| ollama_auto_unload | BOOLEAN | true | — |
| seed | INT | 00–18446744073709550000 | — |
| llm_enabled | BOOLEAN | true | 手动选择是否调用 LLM 进行分段切片。开启:使用 LLM 将提示词按时间轴切分成各段不同的分镜提示词;关闭:不调用 LLM,直接将完整提示词作为各段通用提示词(0 token 消耗)。 |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| prompt | STRING | — |
| batch_index | INT | — |