Nodes/H3 Relay/H3RelayInternalChainContext
ComfyUI Node

H3RelayInternalChainContext

How H3 scenes stay continuous without re-rendering the world

By akatz-ai·Created 28 days ago·Updated 8 days ago· 15
H3RelayInternalChainContext
  • state
  • conditioning
  • vae
  • latent
  • audio_vae
  • conditioning
  • trim_frames
  • is_continuation
  • latent

This is one of those nodes whose category tells you everything: conditioning/minimax/contex_loop. It's the continuation brain of a MiniMax H3 chain. Every shot after the first doesn't start from nothing - it starts from the accepted previous shot's context, and Chain Context is what builds that bridge. The description spells it out: it applies each scene's inherited or overridden guide, sliding history, or masked AV continuation, including scene 1 when Existing Video Context is connected.

The node is a namespaced internal wrapper of the same Chain Context class from the MiniMax H3 Context Loop runtime that H3 Relay vendors in. In the reference workflow it appears as part of the expanded graph, wired between the stock H3 conditioning node and the sampler.

The inputs

  • state - current chain state (tooltip: "from H3 Chain Current Shot"). This carries the plan, the shot index, and what the previous scene left behind.
  • conditioning - from the stock MiniMax H3 Ref2VA/I2V node. Scene 1 passes through without motion context; later scenes receive the saved continuation context.
  • vae - the H3 video VAE, used to encode saved context frames for continuation scenes.
  • latent - the current scene's empty AV latent from the stock H3 conditioning node.
  • audio_vae (optional) - the H3 audio VAE, used only when scene 1 continues from imported video audio. Leave it disconnected for visual-only context or source-track mode.

The three continuation modes

The state's plan picks one of three ways to bridge shots:

  • guide - the default. The previous scene's frames are encoded and fed into the conditioning as a guide. Scene 1 passes through unchanged; every later scene continues.
  • sliding_history - H3's native sliding history, the one tied to the 17k+1 temporal grid you set on Sequence Start. It carries matched visual/audio history into each continuation and needs ComfyUI's H3 history anchors (the pack installs a guarded compatibility layer for older ComfyUI builds).
  • masked_av - the previous scene's AV latent tail is carried into the current target as a masked, preserved prefix. This is the mode that keeps audio continuity across shots and requires H3 mask support; the node fails fast before spending minutes on scene 1 if a later scene needs a mode your ComfyUI can't run.

The outputs - all four matter

  • conditioning - sampler-ready; scene 1 passes through unless Existing Video Context seeds it, later scenes always continue.
  • trim_frames - the number of repeated leading frames to remove after decoding. Wire this to H3RelayInternalLoopTrim, which is how the duplicated context comes off the delivered clip.
  • is_continuation - True for resumed/continued scenes, False for the first. Handy for switching behavior per-shot.
  • latent - sampler-ready target latent. In guide mode it's the input latent unchanged; in masked_av mode it carries the preserved AV prefix and a nested denoise mask. Wire this output to the sampler in both modes so the plan can switch safely.

The reason you'd care even as a non-plumber: this is where per-scene continuity is decided, and if you're building a custom H3 chain rather than using the reference graph, this is the node you'd reach for instead of hand-rolling context encoding. Otherwise, leave it where the graph put it.

Install: ComfyUI Manager (H3 Relay) or git clone https://github.com/akatz-ai/h3-relay.git into custom_nodes. Needs ComfyUI 0.32.0+, FFmpeg, and H3 model files from MODELS.md. License gate stands (MiniMax H3 excludes US/EU/UK/Korea).

Categoryconditioning/minimax/contex_loop

Inputs (5)

NameTypeDefaultDescription
stateH3_CHAIN_STATECurrent state from H3 Chain Current Shot.
conditioningCONDITIONINGConditioning from the stock MiniMax H3 Ref2VA/I2V node. Scene 1 passes through without motion context; later scenes receive the saved continuation context.
vaeVAEMiniMax H3 video VAE used to encode saved context frames for continuation scenes.
latentLATENTThe CURRENT scene's empty AV latent from the stock H3 conditioning node. Chain Context passes it through in guide mode or returns a masked preserved-prefix copy in masked_av mode.
audio_vaeoptVAEH3 audio VAE used only when scene 1 continues from imported video audio. Later loop scenes reuse their saved AV latent directly. It may be left disconnected for visual-only context or source_track mode.

Outputs (4)

NameTypeDescription
conditioningCONDITIONINGConditioning ready for the H3 guider/sampler: scene 1 passes through unless Existing Video Context seeds it; later scenes always continue.
trim_framesINTRepeated leading frames to remove after decoding. Connect to MiniMax H3 Contex Loop Trim.
is_continuationBOOLEANTrue for resumed/continued scenes, false for the first scene.
latentLATENTSampler-ready target latent. In guide mode this is the input latent unchanged. In masked_av mode its preserved AV prefix and nested denoise mask carry the previous scene into the current target. Wire this output to the sampler for both modes so Plan can switch safely.