沐阳 H3 · 分段计划
Turn a 2-minute script into a shot list MiniMax H3 can actually render
- media
- plan_json
- segment_count
- segment_seconds
- frames_per_segment
- plan_preview
- ref_frames_needed
Here's the wall every MiniMax H3 user hits eventually: the model clips out at 4–15 seconds, and your video is a minute. You need to split it into segments, and H3 is picky about the grid those segments land on. H3ScriptSplitter is the first step of that job - it takes one long script and slices it into a per-shot plan on H3's official 17k+5 frame grid, at the model's fixed 24fps. It's the planning head of the 沐阳 H3 pack, the "director's cut" of what was once a lot of fiddly per-segment prompt wrangling.
The mechanism is simple and worth understanding, because it drives the whole chain. You feed it a script (or the myang_prompt output of the Media Agent), and it asks an LLM to cut that script along the time axis into however many segments fit your duration. Each segment gets its own prompt, and all of it is embedded into a single plan_json string - one LLM call for the whole job, not one per shot. If the LLM times out, returns malformed JSON, or produces the wrong segment count, it silently falls back to a local timeline algorithm, so the plan still happens. Leave script empty and it skips the LLM entirely and just computes time and frame math - 0 tokens, pure arithmetic.
The inputs a beginner actually touches:
script- your full prompt or screenplay. Wire the Agent node'smyang_prompthere, or paste raw text.total_seconds/length_source- the total runtime. Switchlength_sourceto "match reference video" and it reads the duration straight off a connected ref video, ignoring the number you typed.segment_seconds- how long each clip should be. H3's grid snaps these, so don't expect exact values back.overlap_frames- the big one. This MUST match thecontext_lengthon the long-video node, because every later segment carries the previous one's tail as temporal context. 22 is the recommended baseline; 5 is the "I'm just testing speed" anchor.max_segments,llm_enabled,use_cache- caps the shot count, controls whether the LLM runs at all, and reuses the last split when script and segment count haven't changed (no repeated token spend).
On the way out you get plan_json (feed this to H3SegmentPrompt), segment_count, segment_seconds, frames_per_segment, plan_preview (a readable dump for checking), and ref_frames_needed - how many context frames the chain will consume.
Where people get burned: the overlap_frames vs context_length mismatch is the classic silent killer - your seams drift and the audio drifts off the picture. And the fps input is locked at 24 for a reason: H3 models at 24fps, and the node will raise an error if you try anything else. Don't fight it.
Install - it ships with the whole pack, so the shared steps apply: ComfyUI Manager, search ComfyUI-MiniMaxH3-Myang (or the "沐阳 H3" display name), install, restart. Manual route is the usual
cd ComfyUI/custom_nodes
git clone https://github.com/civilcoco/ComfyUI-MiniMaxH3-Myang.git
then restart ComfyUI and hard-refresh the browser tab if the node list looks stale. It declares no extra Python dependencies beyond the standard ComfyUI environment, but it does assume you're on a recent ComfyUI build with the official MiniMax H3 nodes - those are the actual models behind this, and you'll need to supply the H3 diffusion model, Qwen text encoder, and both VAEs yourself. Also remember the MiniMax H3 Community License geofences the weights out of the US, EU, UK and Korea - worth reading before you download anything.
Start with two segments at 22 context frames before scaling up. If the seam holds at two, it'll hold at twelve.
Inputs (16)
| Name | Type | Default | Description |
|---|---|---|---|
| script | STRING | 完整提示词/剧本:可接入 Agent 节点的 myang_prompt,或手动粘贴剧本。切片节点会用 LLM 将其按时间轴切分成各段提示词。留空则只算时间与帧数,不调用 LLM。 | |
| total_seconds | FLOAT | 601–3600 | — |
| length_source | COMBO | 用填写的总时长 | 匹配参考视频时长:接上 ref_video 后按它的帧数算总时长,上面填的数就不用管了 |
| segment_seconds | FLOAT | 10.04–20 | — |
| overlap_frames | INT | 220–240 | 必须与长视频 context_length 一致;5 是实验速度锚点 |
| fps | FLOAT | 2424–24 | — |
| llm_service | COMBO | 1 options: 未配置 LLM 服务 | |
| max_segments | INT | 121–12 | — |
| ollama_auto_unload | BOOLEAN | true | — |
| use_cache | BOOLEAN | true | 剧本和段数没变就复用上次的拆分结果,不再调用 LLM |
| seed | INT | 00–18446744073709550000 | — |
| llm_enabled | BOOLEAN | true | 手动选择是否调用 LLM 进行分段切片。开启:优先用 LLM 切片;连续超时、格式错误或段数不对时,自动使用本地时间线算法生成各段不同的提示词;关闭:不调用 LLM,直接将完整提示词作为各段通用提示词(0 token 消耗)。 |
| skill_preset | COMBO | auto | 写作技能:决定每段提示词的输出结构、分镜格式和素材标签写法。auto 会先用一次很短的调用按剧本选技能;none 用默认写法 |
| skill_text | STRING | 自定义写作规则,排在所选技能之前,优先级最高 | |
| vlm_service | COMBO | off | 开启后先让 VLM 看一遍每张图片/视频,把画面内容写进素材清单,LLM 才能按内容判断每段该引用哪个素材;off 时只给文件名和主体名 |
| mediaopt | MINIMAX_H3_MEDIA | 连接 Media Agent 或素材包。切片器会自动感知可用素材清单(图片、视频、音频),在各分段提示词中精准分配 @图片N/@视频N 等素材,并在「匹配参考视频时长」时直接提取视频素材总时长。 |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| plan_json | STRING | — |
| segment_count | INT | — |
| segment_seconds | FLOAT | — |
| frames_per_segment | INT | — |
| plan_preview | STRING | — |
| ref_frames_needed | INT | — |