Nodes/ComfyUI-MiniMaxH3-PrefixStream/MiniMax H3 Trim Prefix Latent (AV Master)
ComfyUI Node

MiniMax H3 Trim Prefix Latent (AV Master)

Cutting overlap straight in latent space

By knoic·Created 2 days ago·Updated about 16 hours ago· 0
MiniMax H3 Trim Prefix Latent (AV Master)
  • images
  • audio
  • latent
  • session
  • cache_config
  • video_latent
  • trimmed_images
  • trimmed_audio
  • trimmed_latent
trim_frames0
fps24.00
match_tailtrue

Here's a ComfyUI quirk worth knowing before you start hunting for a node that doesn't exist: MiniMaxTrimPrefix and MiniMaxTrimPrefixLatent are the same node. The pack registers one class under both names, so if you load an older workflow you'll see "MiniMax H3 Trim Prefix Latent (AV Master)" on the canvas, and if you build from the current example workflow you'll see the "Zero Flicker" naming - and they run identical code either way. Confusing, yes, but it means anything you learn about one applies to the other, and this page exists mostly to say so and to cover the latent-space angle the display name hints at.

What "Latent" actually means here

The node has one main job - cutting the duplicated continuation prefix (the 39–192 frames replayed from the previous clip's tail) off the front of each new segment. Its preferred mode is pixel-space trimming of decoded images + audio, which the sibling page covers in depth. The latent side is the part this name points at: you can also feed the raw sampler output latent into the latent input (or its legacy alias video_latent) and the node will slice off the equivalent latent steps instead of - or alongside - trimming pixels.

When does latent trimming actually earn its keep? Three situations:

  • You're chaining segments headlessly or in batch and don't want to decode/re-encode just to crop - trimming raw steps keeps the operation cheap.
  • You need a trimmed latent to hand to downstream latent-space nodes (stitching, blending, further sampling) where pixel output isn't the deliverable.
  • Your downstream decode chain can't tolerate the empty-batch edge cases, and you'd rather never present it a full-width clip at all.

The catch, and the reason the author steers you to pixel space: trimming latent steps means the frames that remain get decoded after the causal model has already re-sampled the protected head, which is exactly the recipe for VAE flicker and color shift at the seam. Pixel-space cropping sidesteps VAE decoding entirely for those frames. So treat latent as the fallback/utility path, not the upgrade - connect images and audio whenever they're available, and the node trims in the clean space while passing the latent through untouched unless you explicitly wired it.

Inputs and outputs, briefly

trim_frames (default 0) auto-resolves when you connect a session (uses the applier's actual protected frame count) or a cache_config. Connect decoded images/audio for the recommended AV-master trim; fps defaults to 24 and match_tail (on by default) kills the ~8 ms audio/video grid drift that accumulates across clips. It outputs trimmed_images, trimmed_audio, and trimmed_latent - the first two feed your save/combine node, the last is populated only when you gave it a latent.

Install

No extra model or dependency baggage beyond the pack itself:

cd ComfyUI/custom_nodes
git clone https://github.com/knoic/ComfyUI-MiniMaxH3-PrefixStream.git
cd ComfyUI-MiniMaxH3-PrefixStream
pip install -r requirements.txt

Restart, Ctrl+F5. If a workflow you downloaded keeps referencing MiniMaxTrimPrefixLatent, that's fine - it resolves to the same class as the "Zero Flicker" node, so nothing is missing and no extra install is needed. Both names live under MiniMaxH3/PrefixStream in the node menu.

One honest gotcha: because both display names resolve to one class, ComfyUI can't tell them apart in a saved graph beyond the type string - which is why old JSONs keep the Latent name even when the node is trimming pixels. Don't "fix" it by swapping types; just let the workflow load as written.

CategoryMiniMaxH3/PrefixStream

Inputs (9)

NameTypeDefaultDescription
trim_framesINT00–124裁切的前置重叠帧数 (如 22 帧)。设为 0 且连接了 session/config 时将自动识别
imagesoptIMAGE【强烈推荐】解码后的完整画面。在像素空间裁切,彻底杜绝 VAE 闪烁与偏色!
audiooptAUDIO【强烈推荐】解码后的音频。精确同步毫秒级样本截断,杜绝音画不同步
latentoptLATENT原始采样 latent (可选,若已连接 images/audio 则无需裁切 latent)
sessionoptMINIMAX_SESSION
cache_configoptMINIMAX_CACHE_CONFIG
fpsoptFLOAT24.001–120
match_tailoptBOOLEANtrue尾部时长严格对齐:消除 H3 40Hz 音频与 24fps 画面约8ms的网格舍入累积误差
video_latentoptLATENT

Outputs (3)

NameTypeDescription
trimmed_imagesIMAGE
trimmed_audioAUDIO
trimmed_latentLATENT