Nodes/ComfyUI-Apt_Preset/AD_MinMax_Ref2
ComfyUI Node

AD_MinMax_Ref2

Images, clips and audio in one prompt

By cardenluo·Created 2 years ago·Updated a day ago· 320
AD_MinMax_Ref2
  • 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
prompt
width1344
height768
length124
ref_image_sizematch
seed0
fps24
media_type_1
media_type_2
media_type_3
media_type_4
media_type_5
media_type_6
media_type_7
media_type_8
media_type_9
media_type_10
media_type_11
media_type_12
media_type_13
media_type_14
media_type_15
media_type_16

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. match scales to the canvas area (fast, default); max aligns to the 2048 short edge, which the tooltip says gives better identity but runs slower. For face-critical work, max is the one you'd reach for.
  • seed - standard, with control_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.

CategoryApt_Preset/AD

Inputs (42)

NameTypeDefaultDescription
contextRUN_CONTEXT
promptSTRING
widthINT134432–4096
heightINT76832–4096
lengthINT1245–3600帧数(24 fps),自动 snap 到 17k+5 网格(124 ≈ 5s)
ref_image_sizeCOMBOmatch'match' 缩放到画布面积;'max' 对齐 2048 短边(身份更好但更慢)
seedINT00–18446744073709550000
modeloptMODEL
fpsoptFLOAT241–120
mediaoptIMAGE,VIDEO,AUDIO,LATENT,STRING
media_1optIMAGE,VIDEO,AUDIO,LATENT
media_type_1optSTRING
media_2optIMAGE,VIDEO,AUDIO,LATENT
media_type_2optSTRING
media_3optIMAGE,VIDEO,AUDIO,LATENT
media_type_3optSTRING
media_4optIMAGE,VIDEO,AUDIO,LATENT
media_type_4optSTRING
media_5optIMAGE,VIDEO,AUDIO,LATENT
media_type_5optSTRING
media_6optIMAGE,VIDEO,AUDIO,LATENT
media_type_6optSTRING
media_7optIMAGE,VIDEO,AUDIO,LATENT
media_type_7optSTRING
media_8optIMAGE,VIDEO,AUDIO,LATENT
media_type_8optSTRING
media_9optIMAGE,VIDEO,AUDIO,LATENT
media_type_9optSTRING
media_10optIMAGE,VIDEO,AUDIO,LATENT
media_type_10optSTRING
media_11optIMAGE,VIDEO,AUDIO,LATENT
media_type_11optSTRING
media_12optIMAGE,VIDEO,AUDIO,LATENT
media_type_12optSTRING
media_13optIMAGE,VIDEO,AUDIO,LATENT
media_type_13optSTRING
media_14optIMAGE,VIDEO,AUDIO,LATENT
media_type_14optSTRING
media_15optIMAGE,VIDEO,AUDIO,LATENT
media_type_15optSTRING
media_16optIMAGE,VIDEO,AUDIO,LATENT
media_type_16optSTRING

Outputs (3)

NameTypeDescription
contextRUN_CONTEXT
videoVIDEO
textSTRING