AD_MinMax_Ref2
Images, clips and audio in one prompt
- context
- model
- media
- media_1
- media_2
- media_3
- media_4
- media_5
- media_6
- media_7
- media_8
- media_9
- media_10
- media_11
- media_12
- media_13
- media_14
- media_15
- media_16
- context
- video
- text
This is the workhorse of the pack's MiniMax H3 stack: AD_MinMax_Ref2 generates a video from a text prompt plus up to sixteen media inputs - images for identity and style, reference videos for motion, audio clips for soundtrack matching - all numbered and referenced from inside the prompt itself. If AD_MinMax_FL2 is the first/last-keyframe specialist, this one is the generalist: same H3 backbone, but reference-driven rather than keyframe-pinned.
The "Ref2" in the name and the README's update log point at the same thing - this is the reference-guided ("Ref2VA") mode of MiniMax H3, where the model attends to your reference media rather than treating it as hard frames. That's a subtle but real distinction: a reference video can influence motion, but it won't pin the start or end frame the way FL2's keyframes do. Pick Ref2 when you want identity/consistency, pick FL2 when you want literal endpoints.
The media inputs, and the prompt magic
You get media plus media_1 through media_16, each accepting image, video, audio, or latent. The slick part: you can reference them from the prompt text. The node parses tags like <Picture 1>, <Video 2> or <Audio 1> (it also accepts looser forms like @v3 or [img 2], and even Chinese tags - the author's own prompt scheduler) and injects the right media into the H3 tokenizer at the right position. So a prompt can read: "the man from <Picture 1> dances like <Video 2>, with <Audio 1> as the beat." That ordering matters - the media inputs are ordered virtual inputs, and their order in the prompt drives what the model attends to where.
The hard limits (enforced, with clear errors): 9 images, 3 videos, 3 audio clips, and a single context latent. media_type_N lets you override the detected type if the auto-detection ever guesses wrong, but you'll rarely touch it.
The few inputs you actually set
context(RUN_CONTEXT) - required. Carries the H3 model, CLIP, VAE and audio VAE. The node raises a specific error listing whichever of clip/vae/audio_vae are missing.prompt- your scene description with the media tags.length- frames at 24fps, auto-snapped to H3's 17k+5 grid (124 ≈ 5s).ref_image_size("match" default, "max") - how reference images get scaled before encoding.matchscales to the canvas area (fast, default);maxaligns to the 2048 short edge, which the tooltip says gives better identity but runs slower. For face-critical work,maxis the one you'd reach for.seed- standard, withcontrol_after_generate.
Outputs: context (with the sampled latent carried forward), video, and text (the fully-resolved prompt after tag substitution - handy for debugging what the model actually saw).
The chaining trick
This is where the pack earns its keep. If you don't connect a media latent, the node pulls the previous sampler's latent out of the RUN_CONTEXT and feeds it forward as context. That's how you get multi-shot consistency: run one shot, chain the context into the next AD_MinMax_Ref2, and the character stays put. It's the same pattern the pack's flow_stage system formalizes into a whole staged-video loop (see AD_MinMax_Ref2_mul for the multi-stage version). Just remember the context bus's one failure mode - a stale context silently carries an old latent - so if a character suddenly changes identity between shots, check what's actually in the context wire.
Installing it
Part of cardenluo/ComfyUI-Apt_Preset. ComfyUI Manager → search "Apt_Preset", or:
cd ComfyUI/custom_nodes
git clone https://github.com/cardenluo/ComfyUI-Apt_Preset
pip install -r requirements.txt # or install.bat on Windows
Restart, then load an H3 model via the pack's universal loader. You need a ComfyUI build with native comfy_extras.nodes_minimax_h3 - otherwise it dies with "This ComfyUI build does not provide MiniMax H3 support." The pack's optional deps (GGUF, Advanced-ControlNet, nunchaku, Apt_File resources) are only for other nodes in the suite.
Inputs (42)
| Name | Type | Default | Description |
|---|---|---|---|
| context | RUN_CONTEXT | — | |
| prompt | STRING | — | |
| width | INT | 134432–4096 | — |
| height | INT | 76832–4096 | — |
| length | INT | 1245–3600 | 帧数(24 fps),自动 snap 到 17k+5 网格(124 ≈ 5s) |
| ref_image_size | COMBO | match | 'match' 缩放到画布面积;'max' 对齐 2048 短边(身份更好但更慢) |
| seed | INT | 00–18446744073709550000 | — |
| modelopt | MODEL | — | |
| fpsopt | FLOAT | 241–120 | — |
| mediaopt | IMAGE,VIDEO,AUDIO,LATENT,STRING | — | |
| media_1opt | IMAGE,VIDEO,AUDIO,LATENT | — | |
| media_type_1opt | STRING | — | |
| media_2opt | IMAGE,VIDEO,AUDIO,LATENT | — | |
| media_type_2opt | STRING | — | |
| media_3opt | IMAGE,VIDEO,AUDIO,LATENT | — | |
| media_type_3opt | STRING | — | |
| media_4opt | IMAGE,VIDEO,AUDIO,LATENT | — | |
| media_type_4opt | STRING | — | |
| media_5opt | IMAGE,VIDEO,AUDIO,LATENT | — | |
| media_type_5opt | STRING | — | |
| media_6opt | IMAGE,VIDEO,AUDIO,LATENT | — | |
| media_type_6opt | STRING | — | |
| media_7opt | IMAGE,VIDEO,AUDIO,LATENT | — | |
| media_type_7opt | STRING | — | |
| media_8opt | IMAGE,VIDEO,AUDIO,LATENT | — | |
| media_type_8opt | STRING | — | |
| media_9opt | IMAGE,VIDEO,AUDIO,LATENT | — | |
| media_type_9opt | STRING | — | |
| media_10opt | IMAGE,VIDEO,AUDIO,LATENT | — | |
| media_type_10opt | STRING | — | |
| media_11opt | IMAGE,VIDEO,AUDIO,LATENT | — | |
| media_type_11opt | STRING | — | |
| media_12opt | IMAGE,VIDEO,AUDIO,LATENT | — | |
| media_type_12opt | STRING | — | |
| media_13opt | IMAGE,VIDEO,AUDIO,LATENT | — | |
| media_type_13opt | STRING | — | |
| media_14opt | IMAGE,VIDEO,AUDIO,LATENT | — | |
| media_type_14opt | STRING | — | |
| media_15opt | IMAGE,VIDEO,AUDIO,LATENT | — | |
| media_type_15opt | STRING | — | |
| media_16opt | IMAGE,VIDEO,AUDIO,LATENT | — | |
| media_type_16opt | STRING | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| context | RUN_CONTEXT | — |
| video | VIDEO | — |
| text | STRING | — |