MiniMax H3 Contex Loop Plan
One definition that drives every scene in your H3 movie
- chain_policy
- plan
- summary
- clip_count
- width
- height
- video_blend_frames
MiniMax H3 Contex Loop Plan is where a multi-scene H3 movie starts. It's the node that parses and validates your shot list - the plan_json that defines every scene - and turns it into the frame-exact contract the whole chain runs on. The name undersells it: this isn't a text box that holds a prompt list, it's the source of truth for lengths, overlaps, audio windows, seeds, and the checkpoint compatibility hashes that make resume work at all.
If you've opened the maintained workflows you've seen the big Scene Plan interface behind this node. That visual editor is the Plan's front end; the node itself is the engine that validates whatever JSON it receives and computes the derived values (valid lengths, overlaps, seeds) that downstream nodes depend on. For normal work you never hand-write the JSON - that's what the editor is for. Raw JSON is for import, export, and advanced editing.
The inputs that matter
plan_json- the editable production plan. The default is a two-scene skeleton (intro+continuation) you'll replace. Scene prompts may use{first option|second option}alternatives, and can reference@tags, semantic anchors like#hero[2.50s], or native<Picture/Video/Audio N>labels. Reference media is connected elsewhere - the JSON only mentions the tags.run_name- the identity of one render history and its folder underoutput/h3_chains. Keep it unchanged to resume or regenerate that production; use a new name for a separate render. Reusing a name intentionally exposes that run's existing checkpoints to Review Gate and resume - a footgun, but a documented one.generation_fingerprint- the compatibility tag for generation inputs not stored in the JSON. Connect Scheduled Ref2VA'sschedule_fingerprintwhen you use scheduled references; otherwise set a stable tag whenever the model, VAE, LoRA, global refs, CFG, sampler or scheduler changes. Resume rejects a mismatched fingerprint instead of silently mixing runs. This is the node's quiet superpower.width/height- generation size for every scene (default 960×544). Connect the Plan's width/height outputs to the stock H3 node so its latent always matches.context_length- how many previous-scene video frames carry into the next scene. The tooltip is blunt and worth quoting: 22 for guide mode, 39 for the AV mask modes so the AV clocks meet exactly. Larger values strengthen continuity but yield fewer new frames per scene.continuation_mode- the transition recipe:guide,tone_carry_guide, the AV modes (masked_av,tapered_av,feathered_av,drift_control_av...). In 0.5 this is normally driven by connecting a Chain Policy instead - this widget is the legacy fallback.audio_mode-source_track(exact prerecorded audio),generated_audio(H3 makes new sound), orsource_plus_timeline.base_seed- used to derive a stable, different seed for each scene without an explicit one. Review Gate's Reroll does not touch this; it writes an explicit override into the scene's seed field, keeping everything else reproducible.default_duration_seconds,default_steps,segment_crf,video_blend_frames,encode_mode,anchor_mode,crop,audio_context_length- the rest of the tunables. You'll set a handful of these per production; the tooltips are unusually honest about which are experimental.
The optional chain_policy input is the 0.5 route: connect MiniMax H3 Chain Policy (directly, or through Advanced Policy / the Legacy 0.4 adapter) and it supplies transition, final soundtrack, source-audio reference, generated-audio continuity and automatic audio context in one connection. plan_json_input lets another node (an LLM story director, say) supply the complete JSON - a non-empty connected value overrides the editor's internal plan_json for that execution.
The outputs
plan (the validated chain plan → Loop Start and Manifest Load), summary (scene count, delivered duration, compatibility), clip_count, width, height, and a legacy video_blend_frames that 0.5 explicitly tells you not to connect to Loop Trim (wire Current Shot's state to Loop Trim state instead).
Installing it
Part of ComfyUI-MiniMaxH3-Contex-Loop (ComfyUI Manager: "MiniMax H3 Contex Loop"), or:
cd ComfyUI/custom_nodes && git clone https://github.com/ethanfel/ComfyUI-MiniMaxH3-Contex-Loop.git
Restart ComfyUI. Standing requirements: H3 weights and a current ComfyUI with native Add Guide (PR #15439). No models are bundled.
Common issues
The most common failure is a Plan that won't validate: H3 can't generate every frame count, so durations round up to the next valid 17k+5 raw length - if a scene's requested length is invalid the Plan tells you. Changing run_name is the "why did my chain start over?" answer. And changing the Plan after scenes are accepted is exactly what generation_fingerprint and verify_resume_history are watching for: keep the fingerprint stable unless you actually changed generation inputs, then update it deliberately.
Inputs (19)
| Name | Type | Default | Description |
|---|---|---|---|
| plan_json | STRING | { "shots": [ { "id": "intro", "prompt": "Describe the opening shot." }, { "id": "continuation", "prompt": "Continue the same take." } ] } | The editable production plan behind the large Scene Plan interface: shared prompt, ordered scene prompts, optional lengths, sampler steps, per-scene context, continuation, and seed overrides. Use the visual editor for normal work and Raw JSON only for import, export, or advanced editing. Reference media is connected elsewhere; this JSON only mentions native @tags, Tagged Picture semantic anchors such as #hero[2.50s], or native <Picture/Video/Audio N> labels. Scene prompts may use {first option|second option}; Plan resolves each group from that scene's Prompt alternatives control. |
| run_name | STRING | h3_chain | Identity of one render history and its folder under ComfyUI output/h3_chains. Keep it unchanged to resume or regenerate scenes from that same production. Use a new name for a separate render; reusing a name intentionally exposes that run's existing checkpoints to Review Gate and resume. |
| generation_fingerprint | STRING | Checkpoint compatibility tag for generation inputs not stored in plan_json. Connect Scheduled Ref2VA's schedule_fingerprint when using scheduled references. Reference-node outputs retain append lineage, so a newly added ref that is inactive in a completed scene does not invalidate that scene. Otherwise enter/change a stable tag whenever the model, VAE, LoRA, global references, CFG, sampler, or scheduler changes. Resume rejects a mismatched fingerprint instead of mixing runs. | |
| width | INT | 96032–4096 | Generation width for every scene. Connect the Plan width output to the stock Ref2VA/I2V node so its latent always matches the plan. |
| height | INT | 54432–4096 | Generation height for every scene. Connect the Plan height output to the stock Ref2VA/I2V node so its latent always matches the plan. |
| context_length | COMBO | 22 | Legacy 0.4 fallback, hidden in the normal 0.5 interface. Connect Chain Policy for new workflows or the Legacy 0.4 Policy Adapter when rebuilding an old control surface. Default previous-scene video frames used to continue motion. Use 22 for guide mode and 39 for masked_av, tapered_av, feathered_av, or audio_feathered_av/Drift AV so the AV clocks meet exactly. A scene's Advanced selector can override this; blank inherits it and 0 starts a visually new scene. Audio context is controlled separately. With head anchors, those frames are regenerated at the start and Loop Trim removes them, so later scenes deliver raw scene frames minus context_length. Larger values strengthen motion continuity but produce fewer new frames per scene. This does not control reference-audio duration. |
| encode_mode | COMBO | video | How the carried visual overlap is encoded. Use video (recommended) to preserve the previous frames as one motion-bearing latent clip. frames creates separate still-image anchors, costs more conditioning space, and is mainly for diagnosing or experimenting with anchor behavior. |
| anchor_mode | COMBO | head | Where previous frames sit on the next scene's timeline. head is the tested default: it repeats the overlap at the beginning, and Loop Trim must remove exactly trim_frames. before places context at negative time and returns no repeated head; use it only for workflows deliberately built around that experimental timing. |
| crop | COMBO | disabled | How saved context frames are fitted when their shape differs from the Plan canvas. disabled resizes directly to width x height and may change aspect ratio. center preserves aspect ratio, then center-crops overflow. It does not crop Ref2VA picture/video reference inputs. |
| audio_mode | COMBO | generated_audio | Legacy 0.4 fallback, hidden in the normal 0.5 interface and used only when no H3 Audio Policy is connected. It controls timeline continuity and final audio; it does NOT enable or disable @voice/<Audio N> references. For a finished prerecorded voice, dialogue, or song that must remain exact, choose source_track: wire the full track to Loop Start and Assemble, and feed Current Shot's exact slice to Ref2VA/Scheduled Audio. For a short @voice identity/timbre reference while H3 generates new speech and sound, choose generated_audio: no full source track is required, connect the audio VAE to Loop Context, and save trimmed generated audio. source_plus_timeline provides both an exact source slice and previous generated-audio context; it is experimental and usually not the first choice. |
| audio_context_length | INT | 220–240 | Legacy 0.4 fallback amount of previous generated sound carried into the next scene, measured in 24-fps video frames. Normal Chain Policy derives 0/22/39 from Cut, Guide, or AV automatically. This field is active only when the Audio Policy has Generated continuity=on. Legacy generated_audio and source_plus_timeline enable that axis; source_track disables it. AV mask modes use zero versus positive as an audio-carry switch: positive preserves audio for the exact video-prefix duration required by the shared AV clock, while zero leaves audio fully denoisable. A scene's Advanced Audio context can override this default; there, explicit 0 means no audio carry. |
| default_duration_seconds | FLOAT | 15.000.1–149.6666666666667 | Fallback duration only when the scene and JSON defaults both omit a duration/length. H3 cannot generate every frame count, so seconds round UP to the next valid 17k+5 raw length. In head mode, continuation scenes then lose their effective context repeated frames from their delivered duration. |
| default_steps | INT | 201–10000 | Fallback sampler steps only when a scene and the JSON defaults both omit steps. A value set under a scene's Show advanced section overrides this. |
| base_seed | INT | 00–18446744073709550000 | Base used to derive a stable different seed for each scene that has no explicit seed. Review Gate's Reroll seed does NOT change base_seed; it writes an explicit override into that scene's always-visible Scene seed field, leaving every other scene reproducible and checkpoint-compatible. |
| segment_crf | INT | 180–51 | H.264 quality for each saved scene MP4 (and normalized imported prelude): lower means higher quality and larger files. 18 is visually high quality; 0 is lossless and 51 is lowest quality. This does not change model sampling or the saved safetensors continuation checkpoint. |
| video_blend_frames | INT | 00–243 | Default visual blend entering each scene, in frames. A scene's Blend entering scene field can override it; blank inherits this value, capped to that scene's context, and 0 makes a hard cut. A positive value requires head anchors. In a 0.5 workflow, connect Current Shot's state output to Loop Trim's state input; Loop Trim resolves this default plus any scene override automatically. Connect Loop Trim's images_with_overlap output to Segment Save. Final and partial videos are re-encoded with a linear cumulative blend; audio timing and the delivered duration remain unchanged. |
| continuation_mode | COMBO | guide | Legacy 0.4 fallback, hidden in the normal 0.5 interface. Connect Chain Policy for new workflows. Inherited default for scenes without a per-scene continuation override. guide keeps the established Motion Context path: previous AV is supplied as fixed guide rows while the overlap is regenerated. tone_carry_guide uses the RGB guide path and applies the predecessor's detected direct tone curve before VAE encoding. masked_av (experimental) VAE-encodes the previous video tail into the current target latent and protects it with a denoise mask. tapered_av (Detail AV) makes a disposable Gaussian-noised copy of only that carried video prefix before applying the same hard mask; audio is never noised. With Generated continuity on it also copies and protects the matching sampled-audio tail; with that policy off, target audio remains fully denoisable for source/reference guidance. feathered_av uses the same prefix but progressively denoises its final temporal steps for a softer handoff. audio_feathered_av keeps the picture prefix hard while releasing only the last eight audio latent ticks with a half-cosine ramp. drift_control_av keeps the clean predecessor checkpoint unchanged but applies a per-model-evaluation, next-sigma video mask with an 8+4 clean-seam taper; it requires the H3 MODEL to pass through Chain Context. All AV modes require video/head, context >= 5, the Chain Context latent output wired to the sampler, and native or compatible H3 AV-mask support. |
| plan_json_inputopt | STRING | Optional complete scene-plan JSON supplied by another node, such as an LLM story director or reusable STRING source. A non-empty connected value overrides the visual editor's internal plan_json for this execution and passes through the same normalization and validation. Empty or disconnected input uses the internal plan_json unchanged. | |
| chain_policyopt | H3_CHAIN_POLICY | Connect MiniMax H3 Chain Policy directly, or pass it through Advanced Policy or the Legacy 0.4 Policy Adapter. It combines transition, final soundtrack, source-audio reference, generated audio continuity, and automatic audio context in one connection. |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| plan | H3_CHAIN_PLAN | Validated chain plan. Connect it to Loop Start and, for recovery, Manifest Load. |
| summary | STRING | Human-readable scene count, delivered duration, and compatibility summary. |
| clip_count | INT | Number of scenes in the plan. |
| width | INT | Validated generation width; connect to the stock H3 conditioning node. |
| height | INT | Validated generation height; connect to the stock H3 conditioning node. |
| video_blend_frames | INT | Legacy Plan-wide default blend length. It cannot represent a per-scene override because Plan has no active scene. Do not connect it to Loop Trim in 0.5; connect Current Shot state to Loop Trim state. |