Nodes/MiniMax-H3 Prompt Rewriter/MiniMax-H3 Reference Slots
ComfyUI Node

MiniMax-H3 Reference Slots

Your prompt says Voice 1 but the video speaks with Voice 2 — this is the node that stops that

By pytraveler·Created about a month ago·Updated 2 days ago· 179
MiniMax-H3 Reference Slots
  • references
  • picture_1
  • picture_2
  • picture_3
  • picture_4
  • picture_5
  • picture_6
  • picture_7
  • picture_8
  • picture_9
  • video_1
  • video_2
  • video_3
  • video_audio_1
  • video_audio_2
  • video_audio_3
  • audio_1
  • audio_2
  • audio_3
  • summary
soundtracksfalse

Here's the trap. MiniMax-H3's reference mode has a generator node, MiniMaxH3ReferenceToVideo, and it names its references by the socket they land on: whatever sits in ref_image_0 is <Picture 1> in the prompt, ref_audio_0 is <Audio 1>. The prompt writers in this pack name theirs a completely different way - by the draggable strip of squares inside the writer node. Wire the same assets into both by hand and the orders agree right up until the first time you drag a square. Then your prompt describes one voice, the video is handed another, and nothing says so.

MiniMax-H3 Reference Slots closes that hole: it takes what a writer numbered and puts each asset on the output socket carrying that number.

Why you'd reach for it, and what it costs you

Nothing, basically. No model, no download, about twenty milliseconds - pictures and sounds pass straight through and only clips are decoded. In a pack whose headline nodes are 27B language models, this is plumbing. It's also what makes the Ref2VA path trustworthy, and H3's reference mode is famously wording-sensitive: the shipped References to video template says matching the reference tags precisely is most of the job. Tags that lie about which asset is which are a bad place to start.

How it works

The writers expose a references output whose type is the pack's own H3_REWRITER_REFERENCES - not an image, not a video, a small bundle saying what it numbered and in what order. This node unpacks it. Pictures fill picture_1 onwards in strip order, clips fill video_1 onwards, sounds fill audio_1 onwards. Empty sockets hand on nothing, and the generator skips an empty socket and closes its numbering around the gap - the same way the writer closed up its labels when you switched a square off. That's the whole trick, and it's the same null-passthrough idiom every routing node in ComfyUI is built on.

Clips get the real work, deliberately here rather than in the writer: a writer runs whether or not anything is wired to its references output, and fifteen seconds of 1080p as float frames is gigabytes. So a clip travels as the VIDEO it arrived as and is decoded only when this node runs - at 24 fps, on the canvas the generator would scale it to anyway, cut at 15 seconds.

Inputs and outputs that matter

Two inputs. references is the one you wire - from Universal Writer, Prompt Rewriter Omni or Universal Rewriter. soundtracks is off by default and should stay off until you know why it exists: switched on, each clip's own audio goes out on video_audio_N paired with it, which the generator wants, but it renumbers everything. The generator gives a clip's sound an <Audio N> of its own ahead of every standalone sound, and the writers don't count clip sounds - so with this on, the <Audio 1> in your prompt is no longer the sound on audio_1. The summary says by how many labels moved.

Outputs: picture_1picture_9 (IMAGE), video_1video_3 (an IMAGE batch - the clip as frames), video_audio_1video_audio_3 (AUDIO), audio_1audio_3 (AUDIO) and summary (STRING). Nine pictures, three clips, three sounds; anything past that is dropped and reported rather than silently lost.

Wire it once, straight across: picture_1ref_image_0, picture_2ref_image_1, video_1ref_video_0, audio_1ref_audio_0. Then stop touching wires and arrange in the writer's strip, the thing this node can't disagree with.

Install

Same as the rest of the pack - this is one node inside it, not a separate repository.

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

Or search the pack title in ComfyUI-Manager and install from the registry. The pack's requirements.txt pulls transformers, peft, accelerate, safetensors and bitsandbytes - none of which this node touches. It only needs the pack installed and a writer upstream. Restart ComfyUI; it's under the MiniMax-H3 category.

Where people get burned

The big one is not using it. Wiring the same assets to the writer and the generator separately is exactly the arrangement this node replaces, and it works fine until you drag a square - which is the moment you have no way of knowing anything went wrong.

Then, smaller things, all of which show up in summary if you wire it to a text preview - which you should:

  • Fewer than 5 frames. A clip that decodes to under five frames is refused by the generator; summary names the output.
  • Overflow. A tenth picture or fourth sound has nowhere to go - the summary says how many arrived past capacity.
  • Subjects are not pictures. On the Universal Writer, a picture badged as a subject is written as Subject N, never <Picture N>, and the generator has no subject socket - so it goes out after the last picture, the only number the prompt isn't already using.
  • One chain it doesn't cover. A Universal Writer with a block on previous counts that block's labels first, while its references starts from one. Sending it to the generator? One writer per shot.
  • Not the Reference Adapter. That node feeds the writers and hands a clip on as a VIDEO, because a VIDEO is what a writer describes. This one feeds the generator, which wants frames plus a separate sound socket.
CategoryMiniMax-H3

Inputs (2)

NameTypeDefaultDescription
referencesH3_REWRITER_REFERENCESThe 'references' output of a Universal Writer, a Prompt Rewriter Omni or a Universal Rewriter: what that node numbered, in its order.
soundtracksBOOLEANfalsePut each clip's own sound on video_audio_N, paired with video_N. Off by default, because it renumbers the sounds. MiniMaxH3ReferenceToVideo gives a clip's sound an <Audio N> of its own, numbered before every standalone sound, and the writers do not count clip sounds -- so with this on, the prompt's <Audio 1> is no longer the sound on audio_1. Turn it on when the prompt was written with that in mind; the summary says how far the labels move.

Outputs (19)

NameTypeDescription
picture_1IMAGE
picture_2IMAGE
picture_3IMAGE
picture_4IMAGE
picture_5IMAGE
picture_6IMAGE
picture_7IMAGE
picture_8IMAGE
picture_9IMAGE
video_1IMAGE
video_2IMAGE
video_3IMAGE
video_audio_1AUDIO
video_audio_2AUDIO
video_audio_3AUDIO
audio_1AUDIO
audio_2AUDIO
audio_3AUDIO
summarySTRINGWhat went on which output, and where each came from in the writer. Wire it to a preview when a reference is not where the prompt says it is.