CodecOPSD Trims H3 Reference Tokens for 2x Faster Video

ComfyUI Wikinews

CodecOPSD prunes about 70% of the condition tokens in MiniMax-H3 Ref2VA and trains a LoRA on what is left, for roughly 1.9x faster multi-reference video.

Every reference picture or clip you feed H3 Ref2VA becomes more tokens, so multi-reference shots get slow and memory-hungry fast. CodecOPSD throws away about 70% of those condition tokens with a video codec and ships a LoRA that keeps quality on what is left: 1.87x faster denoising, up to 8.4x once three reference videos are in play.
CodecOPSD results on MiniMax-H3 Ref2VA

Stills from the project gallery. Only the tokens the codec keeps reach the transformer; the rest is rebuilt from context.

What it drops

H3 appends every reference (identity, prop, scene, motion clip, first and last frame) to the input sequence as tokens. Most of them repeat spatiotemporal information the model already has. CodecOPSD runs a classical video codec over the reference set, keeps the tokens flagged as new, and a small LoRA trained by on-policy self-distillation learns to generate from that shortened sequence.

ModelCondition tokens droppedDenoising speed
MiniMax-H3 Ref2VA~70%1.87x, up to 8.4x with 3 reference videos or higher-res refs
MiniMax-H3-Image~65%~2x

These figures are the authors' own, from the model card and the arXiv report. The 8.4x is the best case with several conditions.

Five generations, one short film

The card's "Robot versus Monster" film was made in five Ref2VA runs with no teacher pass and no editing: 768x1344, 737 frames, 279,552 condition tokens cut to 90,396 (-68%), 348 s of denoising per part on one B200.

The greybox clip below is what the model was conditioned on (grey boxes stand for the tokens the codec dropped); the second clip is the output from that same condition set.

Run it

There is no ComfyUI node yet: the pruning step sits in front of the transformer, so a plain LoraLoaderModelOnly on the H3 Ref2VA graph will not reproduce these numbers. The weights are a rank/alpha 128 FP32 LoRA (2.6 GB) for transformer_ref.

  • Install the pipeline: git clone https://github.com/Kiteretsu77/CodecOPSD.git && cd CodecOPSD && pip install -e ".[app]"
  • Pull the base weights: python -m codecopsd.download minimax_h3_ref2va --no-examples, then python app.py ref2va for the Gradio UI.
  • Load the adapter with pipe.load_condition_lora("HikariDawn/CodecOPSD-H3-Ref2VA", weight_name="codecopsd_minimax_h3_ref2va.safetensors") before sampling.

Get it

Comments

Sign in with GitHub to join the discussion.

Loading comments…
CodecOPSD Trims H3 Reference Tokens for 2x Faster Video | ComfyUI Wiki