Nodes/ComfyUI-MiniMax-H3-LongMedia/MiniMax H3 • Long Media Sampler
ComfyUI Node

MiniMax H3 • Long Media Sampler

The sampler that turns one H3 prompt into a whole long clip

By vizart-vj·Created 14 days ago·Updated 2 days ago· 71
MiniMax H3 • Long Media Sampler
  • initial_av
  • long_media_plan
  • guider
  • sampler
  • sigmas
  • final_av
  • total_frames
  • trim_frames
  • passes
  • report
seed0
video_context_denoise0.00
audio_context_denoise0.00
offload_completed_segmentstrue
mlp_chunk_tokens8192
attention_modeauto
sol_tau_start1.30
sol_tau_end0.80
sol_curvelinear
sol_min_tokens4096
sol_dense_percent0.00
sol_sink_conditioningexact_kv
sol_qkv_chunk_tokens8192
sol_out_proj_chunk_tokens24576
vram_activation_reserve_mb4096
inter_block_vram_guard_mb2048
inter_block_guard_cooldown_blocks4
inter_block_guard_emergency_mb512
inter_block_guard_emergency_cooldown_blocks3
late_block_guard_start40
late_block_guard_target_mb6144
late_block_guard_min_cached_mb512
step_boundary_cleanup_mb2048
latent_hires_enabledfalse
latent_hires_model(disabled)
latent_hires_scale2.0
latent_hires_precisionfp16
latent_hires_align32
refine_enabledtrue
refine_add_noisefalse
refine_seed0
refine_steps2
memory_modeauto
sampler_modeauto

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 (default auto) - the big one. auto picks existing/Sage attention for small sequences and the embedded Sol path for long ones. existing forces stock attention; sol / scheduled_sol force the embedded Apache-2.0 SM120 Sol path.
  • refine_enabled (default on) with refine_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_noise and refine_seed are 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 from ComfyUI/models/latent_upscale_models, then run the refine pass at the higher resolution. Audio is preserved exactly. Set latent_hires_align to 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.

CategoryMiniMax H3/LongMedia/LongMedia

Inputs (39)

NameTypeDefaultDescription
initial_avLATENT
long_media_planLONG_MEDIA_PLAN
guiderGUIDER
samplerSAMPLER
sigmasSIGMAS
seedINT00–18446744073709550000
video_context_denoiseFLOAT0.000–10 preserves each inherited overlap exactly; 1 fully denoises it.
audio_context_denoiseFLOAT0.000–1
offload_completed_segmentsBOOLEANtrueMove 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_tokensINT81920–131072Token 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_modeCOMBOautoauto 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_startFLOAT1.300–4
sol_tau_endFLOAT0.800–4
sol_curveCOMBOlinear6 options: linear, cosine, sqrt, smoothstep, exponential, step
sol_min_tokensINT4096256–131072
sol_dense_percentFLOAT0.000–0.9
sol_sink_conditioningCOMBOexact_kv3 options: exact_kv, exact_kv_and_rows, off
sol_qkv_chunk_tokensINT81920–131072Stream 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_tokensINT245760–131072Token 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_mbINT40960–12288Extra 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_mbINT20480–8192Minimum 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_blocksINT40–32Completed H3 blocks to wait between normal cache trims. Emergency pressure bypasses this cooldown. 0 restores the 0.2.36 behavior.
inter_block_guard_emergency_mbINT5120–4096Emergency 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_blocksINT30–32Minimum 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_startINT400–127First 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_mbINT61440–12288Driver-free VRAM target before attention/FFN in late H3 blocks. 0 disables the late-block hard guard.
late_block_guard_min_cached_mbINT5120–4096Minimum reclaimable PyTorch CUDA cache required before a late-block hard trim is attempted.
step_boundary_cleanup_mbINT20480–8192Minimum driver-free VRAM target after each completed denoise step. Dead allocator cache is returned before the next H3 forward. 0 disables.
latent_hires_enabledBOOLEANfalseLearned H3 latent hi-res stage between base sampling and refine. Video latent only; audio is preserved exactly.
latent_hires_modelCOMBO(disabled)Checkpoint from ComfyUI/models/latent_upscale_models.
latent_hires_scaleFLOAT2.01–4Spatial latent upscale multiplier. Model supports continuous 1.0x-4.0x.
latent_hires_precisionCOMBOfp16Upscaler inference precision. fp16 is the practical default.
latent_hires_alignINT3216–256Output pixel alignment. 32 is recommended by the upstream model to avoid edge/light-band artifacts.
refine_enabledBOOLEANtrueSplit 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_noiseBOOLEANfalseLegacy compatibility input. Ignored: a true refine stage always continues with no fresh noise.
refine_seedINT00–18446744073709550000Legacy compatibility input. Ignored: refine continues the same trajectory and does not generate fresh noise.
refine_stepsINT21–1000How 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_modeCOMBOautoSampler-local residency policy. auto selects from model-size/VRAM ratio; low_vram and ultra_low_vram work without ComfyUI launch flags.
sampler_modeCOMBOautoauto uses the validated production attention/VRAM policy. manual exposes all low-level tuning widgets.

Outputs (5)

NameTypeDescription
final_avLATENT
total_framesINT
trim_framesINT
passesINT
reportSTRING