Nodes/ComfyUI_MieNodes/MiniMax H3 Loop Plan Generator V2 🐑
ComfyUI Node

MiniMax H3 Loop Plan Generator V2 🐑

Turning One Paragraph Into a Coherent Shot Chain

By MieMieeeee·Created 2 years ago·Updated 2 days ago· 269
MiniMax H3 Loop Plan Generator V2 🐑
  • llm_service_connector
  • images
  • character_1
  • character_2
  • character_3
  • character_4
  • character_5
  • character_6
  • character_7
  • character_8
  • character_9
  • scene_1
  • scene_2
  • scene_3
  • scene_4
  • scene_5
  • scene_6
  • scene_7
  • scene_8
  • scene_9
  • plan_json
  • summary
  • board_kind
  • images
  • assets
◄user_input►
◄enhance_user_inputoff - 不润色(默认)►
◄seed0►
◄scene_count0►
◄total_duration_seconds0►
◄pacingnormal - 正常(语速·推荐)►
◄generation_modeper_shot - 逐场生成(推荐)►
◄camera_disciplineauto - 自动(分镜自由构图)►
◄categorynone - 不指定►
◄output_languageen►
◄seed_modeper_scene_increment - 每场seed递增(推荐)►
◄temperature0.40►
◄max_tokens16384►
◄timeout300►
◄reference_modet2va - 文生视频链(默认)►
◄caption_modecache_memory_disk - 缓存:内存+磁盘(推荐)►

MiniMax H3 makes 4–15 second clips with native audio. Any story longer than a sneeze is therefore a chain of clips, and the hard part isn't generation - it's continuity. Clip two has to pick up where clip one ended, with the same faces, the same room, the same framing logic, and the model has no memory of any of it. The Context-Loop plugin solves that by driving a Production Plan from a JSON blob, and then you have to write the JSON.

This node writes the JSON. You give it a paragraph and a scene count; it gives you a plan_json with per-scene prompts, chain-continuation rules and a shared style prefix, ready for the Production Plan node's plan_json_input.

What it actually does

It's an LLM node, not a template filler. llm_service_connector takes one of the pack's connector nodes - Ollama locally if you have the VRAM, or an API key for SiliconFlow, ZhiPu, Gemini, OpenAI, Anthropic, MiniMax itself, whatever you've configured. The default temperature is 0.4 and timeout is 300 seconds, which tells you roughly what the author expected: a lot of tokens and a slow call.

user_input is free-form: a concept paragraph, or speaker:line dialogue, or a mix. Dialogue gets extracted and packed deterministically; narration goes through the storyboard LLM. Leave it blank and you get a default concept, which is a handy way to see the output shape before committing your own idea.

scene_count at 0 means auto - derived from dialogue line count and pacing, holding at most two spoken lines per scene inside the 14-second H3 window. total_duration_seconds at 0 works the same way. The author is explicit that pacing is speech tempo, not cut density: it changes how fast people talk, not how many times you cut. People who expect it to alter shot count will be confused.

The inputs that change your footage

camera_discipline is the one I'd touch first. auto leaves the storyboard LLM free to alternate shot sizes, and it has a hard rule to cut to close-ups, so a concept line saying "fixed camera" is only a soft hint. locked is enforced in code after normalisation: one composition for the whole board, camera_movement always static_lockoff, no close-up cuts. no_closeups keeps medium and wider with free movement. If you've ever watched an LLM ignore your "keep it wide" instruction, this is the fix - it's not asking nicely.

generation_mode trades money for continuity: per_shot makes one LLM call per scene (recommended) and single_call does the whole board in one cheaper call.

reference_mode decides what the pictures are for - t2va ignores them, i2va anchors scene 1 to <Picture 1>, fl2va alternates end targets, ref2va keeps N pictures active for every scene. Wire images into images (one IMAGE batch): batch[0] is the opening frame for the First-Scene Image Gate, batch[1..] the per-scene end targets.

Then there are the sockets: character_1..9 and scene_1..9, all MIE_ASSET, auto-growing as you wire the tail. Wire a Load Asset's asset output in and the roster is built straight from the bundle - the authored description, voice line and picture, no vision caption call at all. Scene bundles are marked as environment. Slot order (characters, then scenes) is <Picture N>, and wiring two copies of the same asset raises rather than quietly duplicating.

seed_mode defaults to per_scene_increment, which derives each scene's seed from one base the same way the upstream Context-Loop plugin does - seed = 0 means clock-derived per run. Back to seed/determinism if you're comparing prompt variants.

Outputs

plan_json is the headline - string in, Production Plan's plan_json_input, and the schema is byte-compatible with the V1 generator's, so existing wiring doesn't care which one you use. summary is a human-readable digest for a Show Anything node. board_kind tells you whether the board came out as dialogue or narration. images is the assembled picture batch for the video chain. assets is the roster, which goes into Asset → Slots 🐑 so the reference images and audios are literally the ones the prompts were built from - alignment by construction rather than by careful wiring.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/MieMieeeee/ComfyUI-MieNodes
pip install -r ComfyUI-MieNodes/requirements.txt

Or ComfyUI Manager, search ComfyUI_MieNodes. You also need the consuming end - ComfyUI-MiniMaxH3-Context-Loop - and an LLM: either a connector node plus a key in mie_llm_keys.json, or SetOllamaLLMServiceConnector with a local model and no key at all. No model weights ship with this node itself.

Things that go wrong

character_2 is not a character asset bundle means a scene bundle landed in a character socket. The error names the socket, so believe it and move the wire.

More than nine wired bundles raises outright - the H3 manifest caps at nine pictures. And long boards mean long LLM calls: if you're seeing timeouts, raise timeout rather than re-queueing, because a re-queue pays for the whole call again.

The failure that doesn't error is the interesting one. If enhance_user_input (the enhancer) rewrites a dialogue board, it's designed to pin a paraphrase back to your exact line on the first try rather than retry - so if a spoken line comes back altered, look at your source text before blaming the model.

Category🐑 MieNodes/🐑 Prompt Generator

Inputs (36)

NameTypeDefaultDescription
llm_service_connectorLLMServiceConnector—
user_inputSTRINGEverything you want, in any shape: a concept paragraph, speaker:line dialogue, or mixed. Dialogue is extracted then packed deterministically; narration still goes through the storyboard LLM. Blank = default concept.
enhance_user_inputCOMBOoff - 不润色(默认)on: rewrite user_input with the User Input Enhancer before planning. A dialogue board or a single spoken line is cached and kept verbatim — a paraphrase is pinned back on the first try, not retried. A colon line inside ordinary prose is rewritten, not pinned. off (default): use user_input as written. Keep off when the standalone Enhancer is already wired upstream. The rewrite is appended to the run summary. Changing scene_count or duration re-runs planning but reuses a cached rewrite of the same draft and reference_mode.
seedINT00–18446744073709550000Seed base for the per-scene seed chain (scene N gets base+N as a string). 0 = derive from the clock each run.
scene_countoptINT00–128Number of scenes. 0 = auto. Dialogue boards hold at most 2 spoken lines per scene, inside the 14s H3 window (a speaker change does NOT force a cut). Pacing does not change this cut count — it only changes speech tempo and the BRISK/MEASURED prompt directive. Narration boards let the storyboard LLM decide, using pacing as split bias (fast=aggressive, slow=conservative). >0 on a dialogue board: speech is spread evenly across that many scenes, capped at one line per scene — a count above the spoken-line count is capped with a warning; NO silent reaction scenes are manufactured to reach a number (没事尽可能不切 scene, 2026-10-12). A line is never split mid-utterance. 场景数:0=自动(最小切分);显式数字在台词数以内精确生效,超出封顶为每场一句并警告,绝不添加无声反应镜头凑数。 >0 on a narration board: the storyboard LLM produces exactly that many scenes.
total_duration_secondsoptINT00–1800Whole-board duration budget. The storyboard LLM distributes it across scenes; each scene rounds up onto the 17k+5 frame grid, so the delivered total lands close to this (±20% tolerated silently). 0 = auto: derived from dialogue line count and the selected pacing preset (TTS rate + per-turn pause). For concepts without speaker:line dialogue the auto budget falls back to 15s. Set >0 to override the auto estimate. The override actually shrinks shots (clamped to 4-14s each); the old '15 default' no longer applies. MiniMax-H3 single-generation window: 4-15 s per upstream MiniMax-AI/MiniMax-H3 README. This node hard-caps every per-shot duration_seconds at 14 s and emits a preflight warning when clamping occurred.
pacingoptCOMBOnormal - 正常(语速·推荐)SPEECH TEMPO (语速) of the whole board — this is the faster/slower rhythm control, NOT a cut-density control. On a dialogue board with scene_count=0, pacing does NOT change how many scenes you get (auto packing is at most 2 spoken lines per scene, inside the 14s window). It does: 1. Prompt tempo: BRISK / natural / MEASURED injected into the prefix and every shot. 2. Auto length (total=0): TTS rate + turn pause (fast CN 4.5 chars/s + 1.0s, normal 3.5 + 1.5s, slow 2.8 + 2.0s). Narration boards also map fast/normal/slow to the storyboard LLM's aggressive/balanced/conservative split bias. An explicit scene_count is the cut-count override; total_duration_seconds stays the duration constraint.
generation_modeoptCOMBOper_shot - 逐场生成(推荐)2 options: per_shot - 逐场生成(推荐), single_call - 单次调用(快/省)
camera_disciplineoptCOMBOauto - 自动(分镜自由构图)3 options: auto - 自动(分镜自由构图), locked - 固定机位(构图全场不变), no_closeups - 禁特写(中景以上)
categoryoptCOMBOnone - 不指定none: no extra cinematography contract — but once dialogue lines are extracted the board is automatically treated as dialogue (spoken-scene framing, shot/reverse-shot, no on-screen subtitles). dialogue: the same contract, always. action: motion-blur / camera-shake advice. The dialogue verbatim contract runs whenever lines are extracted, on any category.
output_languageoptCOMBOenNarrative language for generated scene prose. English default is recommended for H3 stability; spoken lines still follow dialogue-tag policy.
seed_modeoptCOMBOper_scene_increment - 每场seed递增(推荐)per_scene_increment (recommended): seed_base+index per scene — deterministic but DISTINCT per scene. This mirrors the upstream ComfyUI-MiniMaxH3-Context-Loop plugin's own default, which derives per-scene seeds from one base (sha256(base:index:shot_id)) when the plan omits seeds and relies on that determinism for checkpoint recovery; identical seeds on every clip make consecutive clips sample near-identical noise (repeated motion rhythm). same_across_scenes: every scene shares one seed — use it only when you deliberately want the identical-noise look.
temperatureoptFLOAT0.400–2Advanced tuning: LLM creativity/randomness. Most workflows should keep the default.
max_tokensoptINT1638464–32768Advanced tuning: upper token budget for each LLM call.
timeoutoptCOMBO300Advanced tuning: per-call timeout (seconds).
reference_modeoptCOMBOt2va - 文生视频链(默认)t2va: text-only chain (default). i2va: scene 1 anchored to one <Picture 1>. fl2va: scene 1 + alternating end targets <Picture (N % 2) + 1>. ref2va: N pictures active for every scene (six-section prompt contract).
imagesoptIMAGEOne IMAGE batch, all modes. Wiring (mirror the upstream H3 workflow): batch[0] (Picture 1) is the OPENING frame -> MiniMax H3 First-Scene Image Gate 'image' (i2va/fl2va). For fl2va, batch[1..] (Picture 2..N) are per-scene end targets -> Chain Frame Index Switch frame_1..frame_{N-1} (scene j ends on frame_j, wraps after the last slot). For ref2va, the whole batch -> Reference to Video images (all active every scene). i2va keeps only batch[0] and drops the rest with a warning; t2va ignores images (warning). Scene-transition intent (e.g. '从图一到图二再回到图一' / 'A→B→A') goes in user_input. 1-9 frames. REQUIRED for i2va / fl2va / ref2va.
caption_modeoptCOMBOcache_memory_disk - 缓存:内存+磁盘(推荐)Caption cache strategy for images. cache_memory_disk (recommended): persistent cache. cache_memory_only: RAM-only cache. no_cache: always bypass cache. force_recaption_once: force fresh captions now.
character_1optMIE_ASSET角色槽位 1:接 Load Character Asset 的 asset 输出。接上本槽才会出现下一槽。槽位顺序(角色在前、场景在后)就是 <Picture N>。
character_2optMIE_ASSET角色槽位 2:接 Load Character Asset 的 asset 输出。接上本槽才会出现下一槽。槽位顺序(角色在前、场景在后)就是 <Picture N>。
character_3optMIE_ASSET角色槽位 3:接 Load Character Asset 的 asset 输出。接上本槽才会出现下一槽。槽位顺序(角色在前、场景在后)就是 <Picture N>。
character_4optMIE_ASSET角色槽位 4:接 Load Character Asset 的 asset 输出。接上本槽才会出现下一槽。槽位顺序(角色在前、场景在后)就是 <Picture N>。
character_5optMIE_ASSET角色槽位 5:接 Load Character Asset 的 asset 输出。接上本槽才会出现下一槽。槽位顺序(角色在前、场景在后)就是 <Picture N>。
character_6optMIE_ASSET角色槽位 6:接 Load Character Asset 的 asset 输出。接上本槽才会出现下一槽。槽位顺序(角色在前、场景在后)就是 <Picture N>。
character_7optMIE_ASSET角色槽位 7:接 Load Character Asset 的 asset 输出。接上本槽才会出现下一槽。槽位顺序(角色在前、场景在后)就是 <Picture N>。
character_8optMIE_ASSET角色槽位 8:接 Load Character Asset 的 asset 输出。接上本槽才会出现下一槽。槽位顺序(角色在前、场景在后)就是 <Picture N>。
character_9optMIE_ASSET角色槽位 9:接 Load Character Asset 的 asset 输出。接上本槽才会出现下一槽。槽位顺序(角色在前、场景在后)就是 <Picture N>。
scene_1optMIE_ASSET场景槽位 1:接 Load Scene Asset 的 asset 输出(环境参考,不占 <Subject N>)。
scene_2optMIE_ASSET场景槽位 2:接 Load Scene Asset 的 asset 输出(环境参考,不占 <Subject N>)。
scene_3optMIE_ASSET场景槽位 3:接 Load Scene Asset 的 asset 输出(环境参考,不占 <Subject N>)。
scene_4optMIE_ASSET场景槽位 4:接 Load Scene Asset 的 asset 输出(环境参考,不占 <Subject N>)。
scene_5optMIE_ASSET场景槽位 5:接 Load Scene Asset 的 asset 输出(环境参考,不占 <Subject N>)。
scene_6optMIE_ASSET场景槽位 6:接 Load Scene Asset 的 asset 输出(环境参考,不占 <Subject N>)。
scene_7optMIE_ASSET场景槽位 7:接 Load Scene Asset 的 asset 输出(环境参考,不占 <Subject N>)。
scene_8optMIE_ASSET场景槽位 8:接 Load Scene Asset 的 asset 输出(环境参考,不占 <Subject N>)。
scene_9optMIE_ASSET场景槽位 9:接 Load Scene Asset 的 asset 输出(环境参考,不占 <Subject N>)。

Outputs (5)

NameTypeDescription
plan_jsonSTRING—
summarySTRING—
board_kindSTRING—
imagesIMAGE—
assetsMIE_ASSET_ROSTER—