MiniMax H3 LanPaint AV Prepare / 音画局部重绘准备 (Advanced)
Preparing the mask before the sampler
- frames
- source_audio
- video_vae
- audio_vae
- video_mask
- av_latent
- source_frames
- source_audio
- report_json
LanPaint is the ComfyUI inpainting sampler that adds iterative "thinking" steps during denoising - the community post that announced its HiDream support pitched it as "giving your model a brain boost" for inpaint results, and it works with basically any model. This node is the half of that story for H3 that nobody celebrates: it turns your source frames and audio into a proper joint AV latent with the mask already attached, so the LanPaint KSampler Advanced upstream has something sensible to work on.
The important structural fact: the pack deliberately does not ship its own LanPaint sampler. You install scraed/LanPaint separately, and this node preps what it consumes. The description is blunt about the contract - it encodes the source frames and audio once, attaches exact nested video/audio noise masks, and hands the result to the external GPL LanPaint sampler. If you were hoping this pack would give you the sampler too, that's your first gotcha.
How it works
You feed it frames (the IMAGE batch), source_audio, both VAEs, and a video_mask. It encodes everything once - that single-encode design matters on H3's joint AV latent, where video (24fps) and audio (40Hz) live on separate clocks inside one tensor - and attaches noise masks for both modalities. The audio_intervals string is JSON with the exact seconds to re-render: [{"start":1.2,"end":2.0}] means only that window of audio gets repainted, which is the whole "local repair" idea.
frame_policy is where people trip: strict demands 17n+5 frame counts (H3's grid), while trim_down only trims trailing frames that don't fill a grid. Default is strict, so a 40-frame source will refuse - that's the grid talking, not the node being petty. require_lanpaint_sampler (default true) makes the node fail before encoding if the upstream LanPaint isn't installed, so you can't silently run a plain KSampler and think you're doing LanPaint.
The inputs that matter
video_mask- the mask defining what gets repainted. Everything outside stays untouched.audio_intervals- JSON list of{start, end}seconds. Only these get audio repair.frame_policy-strict(17n+5) vstrim_down. If your footage doesn't fit the grid, trim.require_lanpaint_sampler- leave true; it's your early failure signal.
Outputs
av_latent (the masked joint latent for the LanPaint sampler), source_frames and source_audio (passed through so the later composite has the originals to blend against), and report_json.
Installing it
Pack first: ComfyUI Manager → "MiniMax H3 Audio T8", or git clone https://github.com/T8mars/comfyui-minimax-h3-audio-T8 into ComfyUI/custom_nodes, restart. Then the required external piece:
cd ComfyUI/custom_nodes
git clone https://github.com/scraed/LanPaint
restart again. The pack itself has no mandatory pip deps; LanPaint brings its own requirements when it installs.
Common issues
Fails immediately with a LanPaint error before any encoding. You haven't installed scraed/LanPaint, and require_lanpaint_sampler is doing its job. Install it, don't untick the box.
"Frame count doesn't satisfy 17n+5." Switch frame_policy to trim_down if you're fine losing a few tail frames, or pick a source length that fits the grid.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| frames | IMAGE | — | |
| source_audio | AUDIO | — | |
| video_vae | VAE | — | |
| audio_vae | VAE | — | |
| audio_intervals | STRING | [] | JSON,例如 [{"start":1.2,"end":2.0}];仅这些时段重绘音频。 |
| frame_policy | COMBO | strict | strict要求17n+5;trim_down只裁掉尾部不足一个网格的帧。 |
| require_lanpaint_sampler | BOOLEAN | true | 未安装上游LanPaint时提前报错,避免误用普通采样器。 |
| video_maskopt | MASK | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| av_latent | LATENT | — |
| source_frames | IMAGE | — |
| source_audio | AUDIO | — |
| report_json | STRING | — |