Nodes/ComfyUI-MiniMaxH3-Myang/沐阳 H3 · 分段计划
ComfyUI Node

沐阳 H3 · 分段计划

Turn a 2-minute script into a shot list MiniMax H3 can actually render

By civilcoco·Created 3 days ago·Updated 3 days ago· 1
沐阳 H3 · 分段计划
  • media
  • plan_json
  • segment_count
  • segment_seconds
  • frames_per_segment
  • plan_preview
  • ref_frames_needed
script
total_seconds60
length_source用填写的总时长
segment_seconds10.0
overlap_frames22
fps24
llm_service
max_segments12
ollama_auto_unloadtrue
use_cachetrue
seed0
llm_enabledtrue
skill_presetauto
skill_text
vlm_serviceoff

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's myang_prompt here, or paste raw text.
  • total_seconds / length_source - the total runtime. Switch length_source to "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 the context_length on 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.

Category沐阳 H3

Inputs (16)

NameTypeDefaultDescription
scriptSTRING完整提示词/剧本:可接入 Agent 节点的 myang_prompt,或手动粘贴剧本。切片节点会用 LLM 将其按时间轴切分成各段提示词。留空则只算时间与帧数,不调用 LLM。
total_secondsFLOAT601–3600
length_sourceCOMBO用填写的总时长匹配参考视频时长:接上 ref_video 后按它的帧数算总时长,上面填的数就不用管了
segment_secondsFLOAT10.04–20
overlap_framesINT220–240必须与长视频 context_length 一致;5 是实验速度锚点
fpsFLOAT2424–24
llm_serviceCOMBO1 options: 未配置 LLM 服务
max_segmentsINT121–12
ollama_auto_unloadBOOLEANtrue
use_cacheBOOLEANtrue剧本和段数没变就复用上次的拆分结果,不再调用 LLM
seedINT00–18446744073709550000
llm_enabledBOOLEANtrue手动选择是否调用 LLM 进行分段切片。开启:优先用 LLM 切片;连续超时、格式错误或段数不对时,自动使用本地时间线算法生成各段不同的提示词;关闭:不调用 LLM,直接将完整提示词作为各段通用提示词(0 token 消耗)。
skill_presetCOMBOauto写作技能:决定每段提示词的输出结构、分镜格式和素材标签写法。auto 会先用一次很短的调用按剧本选技能;none 用默认写法
skill_textSTRING自定义写作规则,排在所选技能之前,优先级最高
vlm_serviceCOMBOoff开启后先让 VLM 看一遍每张图片/视频,把画面内容写进素材清单,LLM 才能按内容判断每段该引用哪个素材;off 时只给文件名和主体名
mediaoptMINIMAX_H3_MEDIA连接 Media Agent 或素材包。切片器会自动感知可用素材清单(图片、视频、音频),在各分段提示词中精准分配 @图片N/@视频N 等素材,并在「匹配参考视频时长」时直接提取视频素材总时长。

Outputs (6)

NameTypeDescription
plan_jsonSTRING
segment_countINT
segment_secondsFLOAT
frames_per_segmentINT
plan_previewSTRING
ref_frames_neededINT