AD_MinMax_Ref2_sample
Sample one stage of a MiniMax H3 Ref2 video without eating all your VRAM
- context
- model
- sigma
- context
- sample_latent
- segment_video
- merged_video
MiniMax H3 is the first open-weights video model that generates picture and stereo audio together instead of tacking a foley pass on afterwards - a 33B omni-modal model doing 4–15 second clips with real synced sound. It's also heavy enough that most people's first attempt ends in an OOM, not a bad clip. AD_MinMax_Ref2_sample is the half of the Apt_Preset Ref2 pipeline that actually puts the sampler on the model, and it's built around three separate memory dials because on H3 there are three separate places to run out.
Worth knowing before you spend a weekend on it: H3's weights ship under the MiniMax H3 Community License, which excludes the US, EU, UK and South Korea from its applicable territory. The hosted Hailuo API is fine everywhere; running the local weights is a licence question, not a technical one. ComfyUI-Apt_Preset is the Chinese-community pack for the job (the author is a Bilibili workflow channel, and most node tooltips are still in Chinese), and its H3 nodes are the most developed part of it.
Why it's a separate node from the generator
The Ref2 line is split on purpose. AD_MinMax_Ref2 prepares all the Ref2 conditioning and sampling state - stage prompts, reference media, the latent - and returns it packed in a context without sampling. AD_MinMax_Ref2_sample then takes that prepared RUN_CONTEXT and runs exactly one stage.
That split is the point. Staged generation means you queue a segment, judge it, and decide whether to pay for the next one. Re-rolling just the sampler while the prep state stays cached is the difference between iterating and re-running a ten-minute graph from scratch.
Under the hood it builds a CFG guider from the context's model, positive and negative conditioning, wraps it with your sampling_profile, applies the VAE_TILE scope, and calls the shared sampler. It writes the result back into the context, so anything downstream sees a fresh latent.
Inputs you'll actually touch
- context - the prepared Ref2 context from the prep node. It's required and it isn't optional in spirit: feed this node an unprepared context and you'll get an execution block, not a helpful error.
- sampling_profile - this is the attention/MLP chunking profile: literally how the model's QKV and MLP blocks are broken up internally.
Noneandautoleave it alone; the named profiles go fromSpeed_first | QKV 16384 | MLP 8192down tomaximum_safety | QKV 1024 | MLP 1024. Smaller chunks, less peak VRAM, more time. If you have a 24GB card, start atbalanced; if you're on 12–16GB,low_vramis where you live. - VAE_TILE - tiling for the VAE encode and decode only. The tooltip says it plainly: it does not fix main sampling VRAM. Beginners burn an afternoon here expecting it to.
- latent_sample_tile - spatial tiling of the sampling canvas, 12 presets encoding tiles and pixel overlap.
推荐:2 | 128(recommended: 2 tiles, 128px overlap) is the sane default if you need it at all; going to 6 or 8 tiles is how you finish a clip on a small card and also how you get seams. - fps - only used when the video output gets created. Not a sampling parameter, despite looking like one.
- seed - as usual, the whole run changes; but with stages cached you can re-roll the sampler alone.
Optional: model overrides the context's model for this pass, and sigma lets you supply your own SIGMAS instead of using the scheduler and steps baked into the context. Leave both disconnected unless you're deliberately doing something odd.
Outputs are context, sample_latent, segment_video, and merged_video. Wire segment_video to a preview when you're judging a single stage; merged_video is every stage concatenated so far, which is the one you keep at the end.
Install
Via ComfyUI Manager, search Apt_Preset and install, or:
cd ComfyUI/custom_nodes
git clone https://github.com/cardenluo/ComfyUI-Apt_Preset
Then install dependencies - the README's install.bat is Windows-only, so on Linux/macOS inside your ComfyUI environment:
cd ComfyUI/custom_nodes/ComfyUI-Apt_Preset
pip install -r requirements.txt
That list is genuinely long (onnxruntime, opencv-python-headless, transparent-background, scenedetect, matplotlib, scipy, gguf …), so give it a minute and restart ComfyUI afterwards. If you plan to load GGUF quants of H3, install ComfyUI-GGUF too - the pack's loader checks for it and the README names it as a prerequisite.
Where people get burned
The three memory dials get conflated. VAE_TILE is decode/encode, latent_sample_tile is the sampling canvas, sampling_profile is inside the transformer's blocks. Turning all three down at once when one is your actual problem just makes the render slow and seam-y.
Second: staged pipelines mean the context you're sampling might be older than the edit you just made. The whole context-bus design trades wire spaghetti for invisible state, and the failure mode is that the connection is right and the contents are wrong. When a stage ignores a change you made upstream, re-run the prep node before you start debugging the sampler.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| context | RUN_CONTEXT | — | |
| fps | FLOAT | 241–120 | 仅用于视频创建输出 |
| seed | INT | 00–18446744073709550000 | — |
| sampling_profile | COMBO | None | 模型内部QKV/MLP 分块:token分块+层内算子分块 |
| VAE_TILE | COMBO | default | 只解决VAE 编码、解码阶段的爆显存,不解决主要采样显存 |
| latent_sample_tile | COMBO | None:不分块 | 采样画面分块设置。 |
| modelopt | MODEL | Optional model override. When disconnected, use the model from context. | |
| sigmaopt | SIGMAS | Optional. When disconnected, use the scheduler and steps from context. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| context | RUN_CONTEXT | — |
| sample_latent | LATENT | — |
| segment_video | VIDEO | — |
| merged_video | VIDEO | — |