MiniMax H3 • Long Media Sampler
The sampler that turns one H3 prompt into a whole long clip
- initial_av
- long_media_plan
- guider
- sampler
- sigmas
- final_av
- total_frames
- trim_frames
- passes
- report
This is the heart of the pack. Everything else - Setup, Planner, the AV stream utilities - exists to feed this node. Long Media Sampler takes a long-media plan and expands it into a sequential multi-pass sampling graph: each segment is sampled in turn, context carried across the boundaries, and the results stitched into one final AV latent. When your manual duration exceeds your segment size, this is the node doing the heavy lifting, and it's also where every low-VRAM trick in the README actually lives.
The inputs that matter
Required: initial_av, long_media_plan, guider, sampler, sigmas, seed. Then a long list of knobs, but you only need to think about a handful:
offload_completed_segments(default on) - moves each finished segment's stitched result to CPU RAM instead of piling the whole growing clip on the GPU. Pure VRAM win, zero output difference. Leave it on.video_context_denoise/audio_context_denoise- 0 preserves the inherited overlap exactly, 1 fully denoises it. The safe default is 0; nudge up only if a boundary looks stale.mlp_chunk_tokens(default 8192) - token chunk size for the low-VRAM MLP path. Bigger = faster but more VRAM; 0 disables chunking for A/B tests.attention_mode(defaultauto) - the big one.autopicks existing/Sage attention for small sequences and the embedded Sol path for long ones.existingforces stock attention;sol/scheduled_solforce the embedded Apache-2.0 SM120 Sol path.refine_enabled(default on) withrefine_steps(default 2) - splits your SIGMAS into a main pass plus a low-noise refine tail. The README calls refine-on-with-2-steps the recommended production config.refine_add_noiseandrefine_seedare legacy stubs that get ignored.latent_hires_enabled(default off) - the optional learned H3 latent hi-res stage: upscale the video latent with a model fromComfyUI/models/latent_upscale_models, then run the refine pass at the higher resolution. Audio is preserved exactly. Setlatent_hires_alignto 32 to avoid edge artifacts.
The long VRAM guard family (vram_activation_reserve_mb, inter_block_vram_guard_mb, late_block_guard_*, step_boundary_cleanup_mb) are the emergency brakes. Leave them at defaults unless the console tells you otherwise.
The Sol attention story
Sol is embedded in the pack (an adapted subset of Saganaki22/ComfyUI-sol-attn under Apache-2.0) - no separate install. On very long sequences it can stream QKV in token chunks (retaining K/V as INT8+scale), compress K/V into block summaries, and chunk the output projection. That's the difference between a 30-second single pass being theoretically possible and it OOMing at the first attention layer. The sol_* knobs (tau schedule, min tokens, dense percent) are for when you want to tune that approximation; for most people auto is the right answer and you never touch them.
Outputs
final_av (the stitched latent, straight into Long Media Decode), total_frames, trim_frames, passes (how many segments actually ran - useful to confirm segmentation behaved), and a report.
Install & config
Pack install is the same as ever:
cd ComfyUI/custom_nodes
git clone https://github.com/vizart-vj/ComfyUI-MiniMax-H3-LongMedia
restart, then load an H3 checkpoint + video/audio VAEs (~42.5 GB from MiniMaxAI/MiniMax-H3; community license excludes US/EU/UK/Korea). The README's production advice: sampler_mode=auto, Dynamic VRAM on, and don't launch with --disable-dynamic-vram. For segment sizing, expect roughly 7–10 s on 16 GB, 5–8 s on 12 GB, 4–6 s on 8 GB with a low reference budget.
Troubleshooting
The community reality of H3 is that it's a big model - people on 24 GB cards are fine, and anyone below that is trading speed for VRAM via exactly these knobs. If you OOM, drop segment_seconds in Setup, set reference_budget=low, and confirm offload_completed_segments is on before touching the exotic sol knobs. If the first step of a long run dies specifically in attention, lower mlp_chunk_tokens and sol_qkv_chunk_tokens toward 4096 or 2048. And if seams appear at clip boundaries, check video_context_denoise - at 0 the inherited overlap is preserved exactly, and that's usually what fixes a jump cut.
Inputs (39)
| Name | Type | Default | Description |
|---|---|---|---|
| initial_av | LATENT | — | |
| long_media_plan | LONG_MEDIA_PLAN | — | |
| guider | GUIDER | — | |
| sampler | SAMPLER | — | |
| sigmas | SIGMAS | — | |
| seed | INT | 00–18446744073709550000 | — |
| video_context_denoise | FLOAT | 0.000–1 | 0 preserves each inherited overlap exactly; 1 fully denoises it. |
| audio_context_denoise | FLOAT | 0.000–1 | — |
| offload_completed_segments | BOOLEAN | true | Move each pass's stitched result to CPU RAM once it has been folded in, instead of leaving the whole growing clip resident on the GPU for the rest of the run. Only the accumulator moves — the small per-pass sampling context stays on the GPU as before — so this has no effect on output, only on peak VRAM during long multi-pass runs. Turn off only to restore the previous (all-GPU) behavior. |
| mlp_chunk_tokens | INT | 81920–131072 | Token chunk size for the low-VRAM H3 MLP path. Manual mode uses 512-token increments so low-VRAM users can select 4096/3072/2048/1536/1024/512. 8192 is the current safe default. Larger values are faster but use more VRAM. Set 0 to effectively disable MLP chunking for A/B testing. |
| attention_mode | COMBO | auto | auto selects existing/Sage for smaller sequences and embedded Sol for large sequences without changing H3 tokens. existing forces current Sage/Comfy attention. sol/scheduled_sol force the embedded Apache-2.0 SM120 Sol path. |
| sol_tau_start | FLOAT | 1.300–4 | — |
| sol_tau_end | FLOAT | 0.800–4 | — |
| sol_curve | COMBO | linear | 6 options: linear, cosine, sqrt, smoothstep, exponential, step |
| sol_min_tokens | INT | 4096256–131072 | — |
| sol_dense_percent | FLOAT | 0.000–0.9 | — |
| sol_sink_conditioning | COMBO | exact_kv | 3 options: exact_kv, exact_kv_and_rows, off |
| sol_qkv_chunk_tokens | INT | 81920–131072 | Stream H3 QKV projection in token chunks. In streamed mode token-level K/V are retained as INT8+scale while Sol block summaries stay BF16; Q is reprojected and consumed chunk-by-chunk. This targets very long single-pass clips on limited VRAM. Manual mode uses 512-token increments so 4096/3072/2048/1536/1024/512 are selectable. 0 restores the full fused-QKV path. |
| sol_out_proj_chunk_tokens | INT | 245760–131072 | Token chunk size for the embedded Sol output projection. Smaller values reduce peak VRAM; larger values are faster. Manual mode uses 512-token increments for fine low-VRAM tuning. 0 disables out_proj chunking. |
| vram_activation_reserve_mb | INT | 40960–12288 | Extra VRAM headroom requested from ComfyUI before model loading. ComfyUI will keep fewer H3 weights resident and offload more to RAM, leaving this space for long-sequence activations. 0 disables the extra reserve. |
| inter_block_vram_guard_mb | INT | 20480–8192 | Minimum driver-free VRAM target between H3 transformer blocks. When free VRAM falls below this value and PyTorch is holding >=256 MB of dead reserved cache, LongMedia returns that cache to the driver. 0 disables inter-block trimming. |
| inter_block_guard_cooldown_blocks | INT | 40–32 | Completed H3 blocks to wait between normal cache trims. Emergency pressure bypasses this cooldown. 0 restores the 0.2.36 behavior. |
| inter_block_guard_emergency_mb | INT | 5120–4096 | Emergency driver-free VRAM threshold. Below this value the emergency guard may trim even while the normal guard is cooling down. 0 disables emergency mode. |
| inter_block_guard_emergency_cooldown_blocks | INT | 30–32 | Minimum completed H3 blocks between EMERGENCY cache trims. This prevents Dynamic VRAM/AIMDO free==0 states from causing a trim storm. 0 restores the 0.2.37 immediate-emergency behavior. |
| late_block_guard_start | INT | 400–127 | First H3 transformer block where the late hard guard is allowed to run. 40 targets only the tail of the 50-block H3 stack. |
| late_block_guard_target_mb | INT | 61440–12288 | Driver-free VRAM target before attention/FFN in late H3 blocks. 0 disables the late-block hard guard. |
| late_block_guard_min_cached_mb | INT | 5120–4096 | Minimum reclaimable PyTorch CUDA cache required before a late-block hard trim is attempted. |
| step_boundary_cleanup_mb | INT | 20480–8192 | Minimum driver-free VRAM target after each completed denoise step. Dead allocator cache is returned before the next H3 forward. 0 disables. |
| latent_hires_enabled | BOOLEAN | false | Learned H3 latent hi-res stage between base sampling and refine. Video latent only; audio is preserved exactly. |
| latent_hires_model | COMBO | (disabled) | Checkpoint from ComfyUI/models/latent_upscale_models. |
| latent_hires_scale | FLOAT | 2.01–4 | Spatial latent upscale multiplier. Model supports continuous 1.0x-4.0x. |
| latent_hires_precision | COMBO | fp16 | Upscaler inference precision. fp16 is the practical default. |
| latent_hires_align | INT | 3216–256 | Output pixel alignment. 32 is recommended by the upstream model to avoid edge/light-band artifacts. |
| refine_enabled | BOOLEAN | true | Split the connected SIGMAS schedule into the main pass plus the final low-noise refine tail. Recommended production default: ON with 2 refine steps. |
| refine_add_noise | BOOLEAN | false | Legacy compatibility input. Ignored: a true refine stage always continues with no fresh noise. |
| refine_seed | INT | 00–18446744073709550000 | Legacy compatibility input. Ignored: refine continues the same trajectory and does not generate fresh noise. |
| refine_steps | INT | 21–1000 | How many extra low-noise steps to run after the complete base sampler. Without Latent Hi-Res: stage2 runs the final low-sigma tail. With Latent Hi-Res: stage1 stops early, the denoised x0 is learned-upscaled, then refine_steps runs as an independent same-seed fresh-noise hi-res pass. |
| memory_mode | COMBO | auto | Sampler-local residency policy. auto selects from model-size/VRAM ratio; low_vram and ultra_low_vram work without ComfyUI launch flags. |
| sampler_mode | COMBO | auto | auto uses the validated production attention/VRAM policy. manual exposes all low-level tuning widgets. |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| final_av | LATENT | — |
| total_frames | INT | — |
| trim_frames | INT | — |
| passes | INT | — |
| report | STRING | — |