H3 Ref2V Enhancer
Let a local LLM write MiniMax H3's full-reference prompt
- ref_images
- improved_prompt
MiniMax H3's full-reference (ref-to-video) prompt format is a beast. Six sections, reference labels like <Subject 1> and <Picture 2>, a retention_analysis that says whether each reference was fully_preserved or attribute_transfer - nobody hand-writes that for fun. H3 Ref2V Enhancer exists so you don't have to: type "magic cat shooting lightning at skeletons, match the reference clip's style," and a local LLM spits back the whole structured prompt H3 actually wants.
This is the reference-image variant of the pack's T2V node (that one is text-only). The pack is by Connor Pietrasik - just a few nodes so he can call a rewriter from inside ComfyUI, as he puts it, "because copy/paste is a lot of work." No API key, no model downloads, nothing to fine-tune. It's a wrapper around an LLM you already run.
How it works
Under the hood it's a single HTTP call. The node builds a system prompt that is basically the entire official H3 full-reference rewriting guide - the shot-and-cut rules, camera motion vocabulary, speaker IDs, the <Subject N> / <Picture N> / <Video N> / <Audio N> label system - then sends your initial_prompt to the LLM URL and returns whatever the model writes.
The clever bit for a ref-to-video node: any images you feed in are converted to base64 PNG data URLs and passed to the model as vision content, same shape as a multimodal chat API. That means the LLM behind this node has to be a vision-language model (Qwen-VL class, or a llama-server build with vision support). Feed it a text-only model and you'll get an error or a prompt that ignores your references entirely.
Output is a single string - the finished H3 prompt - which you wire straight into whatever node actually runs H3. It doesn't generate video, it just writes the words.
Inputs and output that matter
initial_prompt(required) - your rough idea. The default(3 second video) A magic cat shooting lightning at skeletonsis a joke; replace it. Mention duration and anything you want preserved from your references.ref_images- the reference images (or a video's frames) the model should analyze. This is what makes it "reference to video."llm_url- the OpenAI-compatible chat-completions endpoint. Defaults tohttp://localhost:8080/v1/chat/completions, which is llama-server's stock address.extra_start_note/extra_end_note- lines injected into the system prompt, handy for workflow-specific rules ("match the lighting in Picture 1" or "always keep dialogue in the original language"). The node cleans up trailing punctuation for you.
Everything comes back as one improved_prompt string.
Installing it
The README's whole setup is three steps: install ComfyUI, install ComfyUI-Manager, and either search "ComfyUI-Prompt-Rewriters" in the Manager or clone it manually:
cd ComfyUI/custom_nodes
git clone https://github.com/ConnorPietrasik/ComfyUI-Prompt-Rewriters
Then restart ComfyUI. There's no requirements.txt and nothing heavy to download - it only needs urllib3, torch, and PIL, which ComfyUI already ships. The real dependency isn't in the repo at all: you need an LLM server running on its own, and the README's recommendation is llama-server. This node is the messenger, not the model.
Where people get burned
- Nothing responds. The default
llm_urlassumes llama-server on port 8080. If you use Ollama instead, point it athttp://localhost:11434/v1/chat/completions. If your server is down, the call times out after 600 seconds and you get nothing but an error. - Vision or bust. This is the Ref2V node - the reference images go through the LLM. A text-only model can't read them, so the output won't reference anything. Match the node to a model with eyes.
- The output is a prompt, not a video.
improved_promptfeeds into whatever node runs H3 in your workflow; forgetting to wire it up is the most common "it does nothing" report. - Small models mangle the format. That guide is huge, and an 8B model that's bad at instruction-following will hand you a prompt that's half a plot summary. The LLM-in-ComfyUI crowd's rule applies: small-and-obedient beats big-and-chatty here.
- One license aside. H3's open weights are geofenced out of the US, EU, UK and South Korea under the MiniMax H3 Community License. This node formats prompts, so it doesn't care - but if you're running local H3 weights in those regions, that's a separate conversation.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| initial_prompt | STRING | (3 second video) A magic cat shooting lightning at skeletons | — |
| llm_urlopt | STRING | http://localhost:8080/v1/chat/completions | — |
| ref_imagesopt | IMAGE | — | |
| extra_start_noteopt | STRING | — | |
| extra_end_noteopt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| improved_prompt | STRING | — |