Nodes/ComfyUI-MiniMaxH3-Contex-Loop/MiniMax H3 Tagged Ref2VA
ComfyUI Node

MiniMax H3 Tagged Ref2VA

How @tags become native H3 references, scene by scene

By ethanfel·Created 17 days ago·Updated about 18 hours ago· 315
MiniMax H3 Tagged Ref2VA
  • clip
  • vae
  • audio_vae
  • references
  • state
  • positive
  • latent
  • compiled_prompt
  • active_references
  • reference_fingerprint
clip_index1
clip_count1
prompt
width960
height544
length124
ref_image_sizematch
reference_policystrict
semantic_anchor_size512
semantic_anchor_modetimestamped_video
cache_for_upscaletrue

This is the node the whole Tagged family feeds. Every picture, video, motion, and audio reference you registered under a @tag chains into MiniMax H3 Tagged Ref2VA, and here's where it actually does something: for the current scene, it activates only the tags that appear in the resolved prompt, renumbers those assets into compact native H3 labels (<Picture 1>, <Video N>, <Subject N>), leaves any unrelated @syntax alone, and hands the result to stock MiniMaxH3ReferenceToVideo. One shared sampling body, zero numeric reference schedules, and each scene's prompt is the entire control surface.

Think of it as the compiler step. The reference nodes declare assets; this node turns a prompt into a per-scene wiring diagram and produces the conditioning that actually drives H3.

The inputs that matter

Wire these once and they mostly stay put:

  • clip, vae, audio_vae - the H3 text encoder, video VAE, and audio VAE. Yes, audio has its own VAE; stock Ref2VA needs all three.
  • references - the final chain from your Tagged Picture/Video/Audio (or Semantic Anchor Bundle) nodes.
  • clip_index / clip_count - connect these to Current Shot's outputs so the active refs change on each recursive iteration and schedule bounds get validated.
  • prompt - the resolved current-scene prompt. Mention @hero_face and it activates; leave it out and it doesn't. This is the field that makes the whole system prompt-driven.
  • width (960), height (544), length (124, H3-valid raw frame count, steps of 17 from Current Shot), ref_image_size (match limits pictures to generation pixel area; max uses H3's high-fidelity 2048px-short-edge path).

Two optional inputs are easy to miss and matter: state (Current Shot state - required if any tagged video uses sequential mode or any tagged audio uses source_timeline, because it supplies exact scene timing), and reference_policy (strict default validates sources and H3's reference capacity; soft keeps the structural checks; disabled makes pack validation warning-only and passes @tags through unchanged). Leave it on strict until something genuinely fights you.

The semantic-anchor path and upscale caching

There's a second, VAE-free route hiding in the optional inputs. Write a tagged picture as #hero_face[2.50s] and, depending on semantic_anchor_mode, it becomes either a timestamped Qwen semantic checkpoint (timestamped_video) or a Qwen-only <Picture N> storyboard cue whose timestamp is written as an approximate prompt instruction (picture_storyboard). Neither creates a VAE reference, and neither is a hard frame or spatial lock - it's semantic guidance. semantic_anchor_size (512 default) trades Qwen token cost against visual detail.

And cache_for_upscale (default on) automatically saves the native reference latents, compact Qwen presentation frames, and original picture masters keyed to the checkpoint fingerprint - that's what lets the pack's deferred upscale loop rebuild pass-2 references without the original reference wires.

Outputs: positive (CONDITIONING into the H3 sampling body), latent (the empty H3 AV latent), compiled_prompt (the exact prompt H3 sees after tags compile - great for debugging), active_references (the scene-local native mapping), and reference_fingerprint.

Install

Part of the Contex Loop pack:

cd ComfyUI/custom_nodes
git clone https://github.com/ethanfel/ComfyUI-MiniMaxH3-Contex-Loop.git

Restart ComfyUI (or Manager → "MiniMax H3 Contex Loop"). Needs a current ComfyUI build with native Add Guide for MiniMax H3 (PR #15439) and the GraphBuilder core it depends on. No models bundled - supply the H3 weights and both VAEs. ffmpeg on PATH preferred for review/assembly; PyAV fallback. Pack is GPL-3.0; H3 weights are territory-restricted (US/EU/UK/South Korea, outputs included). If a reference silently never shows up, check the resolved prompt first - the compiler only activates what the prompt names.

Categoryconditioning/minimax/contex_loop/references/prompt_driven

Inputs (16)

NameTypeDefaultDescription
clipCLIPMiniMax H3 text encoder used by stock Ref2VA.
vaeVAEMiniMax H3 video VAE used to encode active pictures and videos.
audio_vaeVAEMiniMax H3 audio VAE used to encode active standalone or video-paired audio references.
referencesH3_TAGGED_REFERENCESFinal Tagged Picture/Video/Audio reference line, normally from Semantic Anchor Bundle when semantic pictures are registered. A source is active when its registered @tag occurs in the resolved prompt. Tagged Pictures can additionally be used through #tag[timestamp] semantic checkpoints or Picture storyboard cues.
clip_indexINT11–128Current one-based scene. Connect Current Shot clip_index so the active refs change on each recursive iteration.
clip_countINT11–128Total scenes. Connect Current Shot clip_count to validate schedule bounds.
promptSTRINGResolved current-scene prompt. Mention a registered @tag to activate that asset for this scene. Only registered reference tags are replaced with native H3 labels; unrelated @syntax remains unchanged. For a Tagged Picture, #tag[2.50s] creates either a timestamped semantic checkpoint or an approximate Picture storyboard cue at 2.50 seconds into this scene. Neither is a hard frame or spatial lock.
widthINT96032–4096Generation width forwarded unchanged to stock MiniMax H3 Reference to Video.
heightINT54432–4096Generation height forwarded unchanged to stock MiniMax H3 Reference to Video.
lengthINT1245–3600H3-valid raw frame count from Current Shot.
ref_image_sizeCOMBOmatchStock Ref2VA picture sizing: match limits each picture to generation pixel area; max uses its high-fidelity 2048px-short-edge path.
stateoptH3_CHAIN_STATECurrent Shot state. Required by tagged video sequential mode and tagged audio source_timeline. It supplies exact scene timing; masked sequential motion skips the repeated continuation prefix. Dynamic media does not route back through the Plan fingerprint.
reference_policyoptCOMBOstrictstrict validates sources and stock H3 reference capacity. soft retains those structural checks. disabled makes pack-authored validation warning-only, skips missing/invalid tagged media, and passes @tags unchanged. Unregistered @syntax is always preserved because it may represent a subject or dialogue tag.
semantic_anchor_sizeoptCOMBO512Qwen-only #tag[timestamp] image resolution. 512 is the balanced default; 1024 and 1280 retain more visual detail but increase Qwen token cost. This affects only semantic visual tokens, never native Ref2VA VAE reference latents.
semantic_anchor_modeoptCOMBOtimestamped_videotimestamped_video presents each #tag as a scene-local Qwen Video checkpoint. picture_storyboard keeps each tagged image as a separate Qwen-only <Picture N> and writes its timestamps as approximate prompt instructions. Neither mode creates a VAE reference.
cache_for_upscaleoptBOOLEANtrueAutomatically save native H3 reference latents, compact Qwen presentation frames, and original picture masters for target-resolution pass 2. Deferred upscale discovers the cache from the source checkpoint fingerprint.

Outputs (5)

NameTypeDescription
positiveCONDITIONINGPositive conditioning produced by stock MiniMax H3 Ref2VA.
latentLATENTEmpty MiniMax H3 AV latent produced by stock Ref2VA.
compiled_promptSTRINGExact prompt sent to H3 after native @tags and semantic #anchors compile.
active_referencesSTRINGScene-local mapping of native references and Qwen-only semantic anchors.
reference_fingerprintSTRINGAppend-aware fingerprint lineage of the registered source set for Plan checkpoint safety.