AD_MinMax_Ref2_sample
Sample one stage of a MiniMax H3 Ref2 video without eating all your VRAM
- context
- stage_info_data
- model
- latent
- sigmas
- context
- refined_latent
- segment_video
- merged_video
- segment_image
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 (18)
| Name | Type | Default | Description |
|---|---|---|---|
| context | RUN_CONTEXT | — | |
| fps | FLOAT | 241–120 | 仅用于视频创建输出 |
| seed | INT | 00–18446744073709550000 | 固定种子;仅在手动修改 seed 数值时改变。 |
| sample_mode | COMBO | base | base:基础采样(非放大);pixel_refine:图像域放大精修;latent_refine:潜空间放大精修。 |
| refine_model | COMBO | None | Optional image upscaler before the second pass. None resamples the first-pass latent directly. Use None or a 1x model for multi-stage latent continuity. |
| upscale_output_scale | FLOAT | 1.000.5–1 | 最终倍数 = 当前系数 × 模型倍数 |
| refine_denoise | FLOAT | 0.300–1 | Denoise strength for the second sampling pass. |
| latent_model | COMBO | (place MiniMax H3 3D models in models/latent_upscale_models) | 1 options: (place MiniMax H3 3D models in models/latent_upscale_models) |
| latent_scale | FLOAT | 1.301–4 | MiniMax H3 latent upscale multiplier between the two sigma ranges. |
| low_sigma_start_step | INT | 20–10000 | Used only without an external SIGMAS input. |
| sampling_profile | COMBO | None | 模型内部QKV/MLP 分块:token分块+层内算子分块 |
| VAE_TILE | COMBO | None | None:采用官方默认 VAE 分块方式;其余档位手动指定 VAE 编码/解码分块。 |
| latent_sample_tile | COMBO | None | None:不分块。百万像素以下的 H3 潜空间采样分块。质量优先档会按画幅和长边自动选择 192-320 像素重叠并启用中央桥接;慢速档使用 256 重叠和中央桥接,接缝最好;中速档使用 192 重叠,接缝表现中等;快速档使用 128 重叠,速度更快但接缝较差。6|64 和 8|64 仅用于非常省显存/极限省显存。 |
| create_video | BOOLEAN | true | When disabled, only sample latent; skip image/audio decoding and video creation. |
| stage_info_dataopt | FLOW_STAGE_INFO | — | |
| modelopt | MODEL | — | |
| latentopt | LATENT | — | |
| sigmasopt | SIGMAS | External sigmas are sampled directly. |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| context | RUN_CONTEXT | — |
| refined_latent | LATENT | — |
| segment_video | VIDEO | — |
| merged_video | VIDEO | — |
| segment_image | IMAGE | — |