Minimax_H3_AutoContext_Sampler
The node that stitches MiniMax H3 clips into long videos without OOMing
- model
- vae
- audio_vae
- clip
- parameter
- sampler
- sigmas
- latent_input
- info
- first_frame
- last_frame
- ref_images
- ref_videos
- ref_video_audios
- ref_audios
- drive_audio
- latent
- denoised_latent
- info
MiniMax H3 is a 33B omni-modal video model and it's genuinely good - native stereo audio, motion control that people compared to Kling, day-zero ComfyUI support. But "long" means roughly 15 seconds, and on a consumer card even that is a squeeze. This node is the workaround: instead of asking H3 for the whole thing at once, it cuts the video into chunks, generates each one separately, and hands every new segment the tail of the previous one as an anchor so motion, position and audio carry across the join. That relay is the "AutoContext" in the name.
This is the pack's main node, and it has an opinionated division of labor: the sampler refuses to be prompted directly. All your prompt, resolution and frame-count settings live in the sibling H3Parameter node, which feeds a dict into this node's required parameter input. One parameter node, one sampler, nothing else to wire.
How it works
The sampler takes total_frames and splits them into chunk_frames-sized segments. Here's the subtle bit that explains every weird frame number in this pack: H3's VAE compresses 17 video frames into 5 latent time steps, so valid frame counts sit on a 17n+5 grid - 5, 22, 39, 56, 73, 90… The node snaps your numbers onto that grid automatically, which is why the defaults (362 total ≈ 15s at 24fps, 90 per chunk, 22 context) are all on it.
Each non-first segment starts from the previous segment's last context_frames - the model "relays" from that ending frame, that motion, that audio, and the overlap is generated then trimmed off. video_context_denoise controls how hard that relay head is redrawn: 0 freezes the previous tail exactly (no seam), 1 fully redraws it, middle values soft-mix. Leave it at 0 for a first pass. If you're running a second pass through SplitSigmas, set it to 1 - the README is explicit that 0 can smear the boundary there.
The inputs that matter
The four model ports (model, vae, audio_vae, clip) plus parameter are the core. Then the ones you'll actually touch:
latent_input- wire a first-pass latent here (optionally after a latent upscaler) to start a second pass. Resolution follows the input latent and ignores width/height, so you can do low-res first pass → upscale → high-res second pass.info- feed theinfooutput of a previous sampler in so both passes split the video identically.first_frame/last_frame- end-frame anchoring (FL2VA), great for a locked opening shot or a loop.drive_audio- lock the video to a specific soundtrack; pair it withaudio_drivein the parameter node.
ref_image_N, ref_video_N and ref_audio_N are autogrow reference ports, and there's a gotcha buried in the README: references are only passed to a segment if that segment's prompt actually names them. No memory across chunks - if chunk 2 needs image1, chunk 2's prompt has to say image1 again.
Outputs
latent- the assembled AV latent. Into VAE Decode, or back around for a second pass.denoised_latent- the clean handoff for pass two.info- the chunking dict for the next sampler, so multi-pass runs stay consistent.
Install
ComfyUI Manager, search ComfyUI_MinimaxH3_AutoContext, or:
cd ComfyUI/custom_nodes
git clone https://github.com/supElement/ComfyUI_MinimaxH3_AutoContext.git
then restart ComfyUI. Dependencies are torch/numpy (you already have those from ComfyUI) plus scenedetect and opencv-python-headless, which the seam-correction sibling pulls in. The pack downloads no model - you supply H3 via ComfyUI's native MiniMax H3 support (weights are MiniMaxAI/MiniMax-H3 on HuggingFace). And the honest pre-flight warning: the H3 Community License doesn't license US/EU/UK/Korea users to run the local weights at all, so check that before you build a workflow around this.
The trap: latent cache
enable_cache is on by default and writes each finished segment to a seg_XXXX.pt file, so an interrupted run skips straight past finished chunks. Good. But the cache key is a hash of upstream parameters, and that hash won't notice a model, LoRA or SageAttention swap. When you change any of those, delete the node's cache folder (ComfyUI/output/cache/node_<NodeID>) to force a fresh run. cache_dir lets you point the cache wherever you want - the README recommends giving different samplers different directories so their caches don't collide.
This is a small pack (author supElement, who also maintains ComfyUI_Element_easy) and it's very fresh - but the two bundled two-pass workflows are a solid starting point, and once you internalize the 17n+5 rule and the cache, it just works.
Inputs (26)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| vae | VAE | — | |
| audio_vae | VAE | — | |
| clip | CLIP | — | |
| parameter | DICT | 参数组输入 (必选,来自 Minimax_H3_AutoContext_parameter 节点)。提示词与分段/分辨率/音频参数均由此传入;info 中的分段参数优先于本参数组 | |
| video_context_denoise | FLOAT | 0.000–1 | 段间续接 overlap 头去噪强度 (仅非首段生效)。0=精确冻结上一段尾部 (消除接缝停顿/错位),1=完全重绘 (旧行为),中间值=软混合。二采接 SplitSigmas 时建议设 1 避免花屏 |
| seed | INT | 00–18446744073709550000 | — |
| steps | INT | 301–100 | — |
| cfg | FLOAT | 1.00–30 | — |
| sampler_name | COMBO | euler | 16 options: euler, euler_ancestral, euler_cfg_pp, res_multistep, res_multistep_cfg_pp, dpmpp_2m, +10 |
| scheduler | COMBO | simple | 7 options: simple, normal, karras, exponential, sgm_uniform, beta, +1 |
| denoise | FLOAT | 1.000–1 | 重绘强度。1.0=全量重采样,越小保留越多原结构。连接 sigmas 且 denoise≠1 时 final_sigmas=sigmas*denoise |
| enable_cache | BOOLEAN | true | 是否启用分段缓存。开启后,采样结果会保存到 cache_dir,后续运行时若参数一致则直接加载。 更换模型/LoRA/加速节点后请手动删除缓存文件。 |
| clear_cache | BOOLEAN | false | 删除该节点的所有缓存文件。用于更换模型/LoRA/加速器后强制重新生成。 |
| ignore_latent_hash | BOOLEAN | false | ⚠️ 高级选项:禁用二采输入 Latent 指纹校验。 仅当latent放大节点导致哈希不稳定时启用。 |
| sampleropt | SAMPLER | 外部采样器对象 (SAMPLER, 可选)。接入后覆盖内置 sampler_name/scheduler,与 SamplerCustom 同款接法 | |
| sigmasopt | SIGMAS | 自定义 sigma 序列 (SIGMAS, 优先级最高, 与 SamplerCustomAdvanced 接法一致)。接入后接管采样 sigma;denoise≠1 时 final_sigmas=sigmas*denoise | |
| latent_inputopt | LATENT | 二采输入 latent (可选)。接上一节点或 latent 放大节点输出的 latent 开启二次采样;空间分辨率以该 latent 为准,忽略 width/height | |
| infoopt | DICT | 参数继承输入 (来自上一个同款节点的 info 输出)。info 中存在的分段参数覆盖 parameter/本节点同名值,保证多节点分段一致 (二采/多采串联) | |
| first_frameopt | IMAGE | 首帧锚定 (FL2VA 模式) | |
| last_frameopt | IMAGE | 尾帧锚定 (FL2VA 模式) | |
| ref_imagesopt | COMFY_AUTOGROW_V3 | — | |
| ref_videosopt | COMFY_AUTOGROW_V3 | — | |
| ref_video_audiosopt | COMFY_AUTOGROW_V3 | — | |
| ref_audiosopt | COMFY_AUTOGROW_V3 | — | |
| drive_audioopt | AUDIO | 音频驱动源 (Audio Drive)。接要锁定的源音频,开启 audio_drive 后 输出音频=这条音频本身 (口型/节奏由它驱动)。可与 ref_audio_0 接同一条音频 |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| latent | LATENT | — |
| denoised_latent | LATENT | — |
| info | DICT | — |