ComfyUI Node

MiniMax-H3 RefMod

A Reference You Only Pay to Encode Once

By pytraveler·Created 3 months ago·Updated about 16 hours ago· 393
MiniMax-H3 RefMod
  • vae
  • audio_vae
  • visual
  • audio
◄refmod▾►
◄strength1.00►

Most references in a video graph are a wire from a Load Image node. A RefMod is different: a file on disk holding H3's VAE latent of a look or a voice, already encoded, with a header saying which. You pay that encode once instead of pushing the same ten photos through the VAE every run.

MiniMax-H3 RefMod is the node that picks one out of models/refmods and plugs it into a writer's strip - Universal Writer, Prompt Rewriter Omni, Universal Rewriter. It isn't a loader in the checkpoint sense; it's a picker with two outputs.

Why you'd want one

H3's reference mode is the reason people are excited about the model at all. The launch-day argument was that reference-to-video eats a pile of jobs people used to train a LoRA for - hand it pictures of a person and a place, ask for something new. Shot after shot, the reference never changes, so a RefMod freezes it: one latent plus whatever the file remembers, like a subject name.

The format belongs to ComfyUI-MiniMaxH3Mod. This pack reads RefMods - the shared ones on Hugging Face, that pack's single-file bundles, the ones ComfyUI-Fantastic-MiniMaxH3-PromptBuilder writes - but doesn't make or edit them. The node arrived in 0.32.0, so an older install won't have it.

How it works

It scans every folder ComfyUI knows as refmods - ComfyUI/models/refmods by default, registered under that name so an extra_model_paths.yaml line reaches the same files everywhere. The safetensors header is parsed by hand, so opening the dropdown doesn't import torch and doesn't stall. A file is a picture, a clip, a stack of photos or a voice according to its header, so you never tell it which.

Two files can be one entry: one bundle with both halves inside, or a pair named <name>_visual and <name>_audio beside each other. Subfolders become part of the name, so characters/hero doesn't collide with another hero.

strength is the interesting widget. At 1 it's the reference as saved. Lower and the latent is mixed toward a heavily blurred copy of itself - pooled eightfold, interpolated back - so colour, layout and broad shape survive while the detail goes. The pictures H3's text encoder is shown are weakened the same way, because those would hand the detail back otherwise. The asymmetry matters: the writer still reads it at full strength. You're loosening the generator, not confusing the captioner.

The VAEs are only for that reading. Connect vae and a look whose file keeps no pictures of itself is decoded once - most files shared on Hugging Face - and audio_vae does the same for a voice, so a captioner listens instead of trusting the saved description.

Inputs and outputs

  • refmod - the entry, by its path under models/refmods. Press R in the graph to pick up files you just added.
  • strength - 0 to 1 in steps of 0.05, default 1.
  • vae, audio_vae - optional; needed if you want a writer to see or hear the thing. Generating alone doesn't require them.

visual and audio are typed outputs, not raw media, and each goes into a square of its own on a writer's strip, badged mod. The strip settles what it's called - a clip or a stack is a <Video N>, a voice an <Audio N> - and the writer's references output carries the RefMod itself, latent and all, to MiniMax-H3 Reference Encode, which hands the generator the saved latent rather than encoding it again. That hop matters: MiniMaxH3ReferenceToVideo has no socket for a RefMod and tells you so.

Install

The pack install, plus the files:

cd ComfyUI/custom_nodes
git clone https://github.com/pytraveler/MiniMax-H3-Prompt-Rewriter-ComfyUI

Drop your .safetensors RefMods into ComfyUI/models/refmods and restart. Nothing here is a special dependency. The pack's template 8 - RefMods to video wires the whole chain, file to finished video, which is the fastest way to see the shape of it.

Where people get burned

An empty dropdown reading (no RefMods in models/refmods) is a folder problem, not a node problem - check the path, then press R. Added a file and it's still missing? R again: the node fingerprints on file size and mtime on purpose, so a file rewritten in place counts as a different RefMod under the same name.

A wrong VAE is refused by name - "has to be decoded with the MiniMax-H3 video VAE, and the VAE connected is another one" - rather than decoding to mush.

A voice-only entry leaves visual empty. Correct, not broken: wire both outputs anyway, since writers skip an empty socket. The reverse trap is expecting a writer to describe a look-only entry without vae connected; then the description can't come from pixels.

And watch the cost. A stack of photos is expensive in a way one picture isn't: ten photos at 1024×1824 is 18,240 tokens through every sampling step, as much as eighteen reference pictures at 1344×768. The node's caption says what the file costs, and strength doesn't change it - the one dial people expect to help and doesn't.

CategoryMiniMax-H3

Inputs (4)

NameTypeDefaultDescription
refmodCOMBOThe RefMod to use, by its path under models/refmods. A look and a voice saved together -- one bundle file, or a pair named <name>_visual and <name>_audio -- are one entry with both outputs filled. Press R in the graph to list files added since.
strengthFLOAT1.000–1How strongly the generator follows this RefMod. 1 is as saved. Lower mixes the latent toward a heavily blurred copy of itself -- colour, layout and the broad shape stay, the detail goes -- and the pictures H3's text encoder is shown are weakened the same way. The writer still reads it at full strength.
vaeoptVAEThe MiniMax-H3 video VAE. Decodes a look whose file keeps no pictures of itself, once, so a writer can describe it -- which is most files on Hugging Face. Not needed when the writer is bypassed: 'Reference Encode' decodes it then.
audio_vaeoptVAEThe MiniMax-H3 audio VAE. Decodes a voice so a writer can hear it. Without it the Universal Writer uses the description saved with the voice, if there is one.

Outputs (2)

NameTypeDescription
visualH3_REWRITER_REFMODThe entry's picture, clip or stack of photos, for a square of a writer's strip. Empty when the entry is a voice alone.
audioH3_REWRITER_REFMODThe entry's voice, for a square of its own. Empty when the entry has no voice.