MiniMax-H3 Prompt Reducer
MiniMax-H3 Prompt Reducer
- options
- short_prompt
- scene
Every other node in the pytraveler MiniMax-H3 pack expands: a one-line idea in, a dense, structured audio-video description out - the format MiniMax-H3 wants, with shot markers, camera moves, a soundscape and a music cue. This one runs the loop the other way. Paste in a finished H3 prompt and it hands you back the short line it could have been written from. Four hundred words of blocking and light and "low-angle tracking shot" collapse into "A black cat walks along a wooden fence in a yard at dusk."
If you've ever wanted to change one word of a prompt you liked and winced at the other 399 sitting in front of it, you already know why this node exists. Three jobs: edit without a full rewrite (reduce to a line, change the line, feed it back through a writer), cross-model translation (an H3 prompt is H3-shaped; Wan, Hunyuan and Kling are not, so when H3 prose has to drive one of those, this is the bridge), and a readable line on a saved prompt for the pack's prompt library.
How it works - half of this is not AI
The trick, and it's a genuinely good one: an H3 prompt is not prose, it's a known shape. Field labels, the fixed alignment sentence at the top, [Shot 2] At 0:03 cut markers, <Picture 1> reference tags, <d>[English] ...</d> dialogue fences, the whole soundscape and music sections - all recognizable by rule, and all of it comes off in Python before a model is ever asked anything. What reaches the LLM is one clean paragraph of ordinary description under a short "shorten this" instruction. That's why a 4-billion-parameter model does this job well, where it would founder on "reverse this 400-word document."
Reference bindings go off with the rest of the scaffolding, deliberately: for Ref2VA prompts, subject_definitions and retention_analysis describe assets - pictures the next run won't have.
The inputs that matter
detail-ideais the bare line (ten words max),sentencelets in the place and time of day,paragraphkeeps one sentence per thing that happens (what a multi-shot prompt needs if its order is to survive).subjects- how specifically people are named:as written,age and gender, orimpersonal.impersonalturns people into "a subject" - that's for templates you'll fill in later; fed to a generator as-is it produces the anonymous nothing it asks for.keep_camera/keep_audio/keep_style- all off by default. The camera is usually the writer's invention, not yours; leaving it out lets the next rewrite choose again. Andkeep_audiooff isn't a soft ignore - the parser drops the sound sections outright, so they never reach the model.language- empty means "language of the input." Here it's a second pass: shorten first, then translate the finished line in its own request. It has to be two passes - the worked example in the instruction is English, and a model copying the demo copies its language too.greedy- keep it on. Sampling is exactly what turns "a black cat" into "a sleek obsidian feline," and this node doesn't want that.
The model list is any instruction-following GGUF - the same list the pack's writer nodes use, including on disk: and ollama: entries. Because the hard half is done by the parser, the smallest entry is a reasonable choice here even when it isn't for writing. Two outputs: short_prompt (the line) and scene (the description with scaffolding stripped and nothing else done - no model touched it). Wire scene when the deterministic half is all you wanted.
Installing it
The node ships in the MiniMax-H3-Prompt-Rewriter-ComfyUI pack, installable from ComfyUI Manager (search the pack title) or:
cd ComfyUI/custom_nodes
git clone https://github.com/pytraveler/MiniMax-H3-Prompt-Rewriter-ComfyUI
Then restart ComfyUI. Here's the part that surprises people: this node is the cheap end of the pack. The big 27B rewriter wants a ~52 GB Qwen3.6-27B plus a LoRA and a chunky requirements.txt (transformers, peft, bitsandbytes). The reducer wants none of that - just a small GGUF, and the GGUF route needs nothing pip-installed. llama.cpp is used if ComfyUI's environment already has it; otherwise the node fetches the official llama.cpp binaries (about 34 MB CPU, ~511 MB CUDA) on first run. Nothing here loads a MiniMax-H3 checkpoint, and on an 8 GB card a ~2.6 GB Qwen3.5-4B runs it in seconds.
Where people get burned
- Wrong-language output. If the sibling node MiniMax-H3 Reduce Prompt (any LLM) hands you prose in the wrong language, that's its one-request limit showing - the Reducer's two-pass translate is the reliable path, and small models actually obey it.
- Purple prose.
greedyoff means the reducer expands stylistically. If your "black cat" keeps coming back as "an ebon-furred nocturnal hunter," flip it back on. - Models not in the dropdown. Drop a GGUF in ComfyUI's
models/LLMand it appears ason disk:; if you run Ollama, its models show up asollama:entries with no extra download. keep_model_loadedstays off by default on purpose - this same GPU has to run video generation next. Leave it.
Worth knowing as a loop: Reducer → edit the line → writer → Prompt Check. If the cat is still on the fence when that circuit finishes, both halves of the pack are behaving - and it's the cheapest way to find out whether a given small model is any good at this.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | The finished prompt to shorten. Any of the five tasks, and it does not have to be said which: the text is split against every field name either family uses, and one with no field names at all is read whole as the description. A writer node's output, a loaded text file, or something pasted in. | |
| model | COMBO | Any instruction-following GGUF, from the same list the guided writers use. This asks much less of a model than writing does -- the format is gone before the model sees anything -- so the smallest entry in the list is a reasonable choice here even if it is not one there. | |
| detail | COMBO | sentence | How much comes back. 'idea' is the bare line -- one short sentence, ten words at most. 'sentence' allows the place and the time of day. 'paragraph' keeps one sentence per thing that actually happens, which is what a prompt with several shots needs if the order is to survive. The example the model is shown is picked to match, which does more for the length than the instruction does. |
| subjects | COMBO | as written | How specifically the subjects are named. Separate from the length: a one-line prompt can still say 'a woman in a red coat'. 'as written' keeps appearance and clothing. 'age and gender' cuts every person down to 'a young woman', 'an elderly man'. 'impersonal' drops even that: a person becomes 'a subject' and anything else its bare kind. 'impersonal' is for templates you fill in afterwards. Fed to a generator as it stands, it produces exactly the anonymous nothing it asks for. |
| keep_camera | BOOLEAN | false | Keep the shot size, the angle and the camera move. Off by default: the camera is usually the writer's invention rather than yours, and leaving it out lets the next rewrite choose again. |
| keep_audio | BOOLEAN | false | Fold the soundscape and the music into one clause at the end. Off by default, and off means the sound sections never reach the model at all -- they are dropped by the parser, not by the instruction. |
| keep_style | BOOLEAN | false | Keep the medium and the look the prompt opens with -- live-action, animation, cinematic, documentary. Worth turning on when the look is the point and not a default. |
| language | STRING | Which language the short prompt comes back in. Empty means the language of the input, which for an H3 prompt is English. Write a language name: English, Russian, Chinese, Deutsch -- whatever the model is likely to recognise. The Reducer does this as a second pass: it shortens first and translates the finished line afterwards, in its own request. Asking for both at once does not work -- the worked example in the instruction is in English, and a model copying the demonstration copies its language with it. Translating afterwards has one objective and no example to copy, and small models obey it. It costs one short generation on a model already loaded. 'Reduce Prompt (any LLM)' can only build one request, so there the language is a rule inside it and is obeyed or not depending on the model. If a short prompt comes back from that node in the wrong language, this is why, and the Reducer is the reliable path. | |
| greedy | BOOLEAN | true | Deterministic decoding. Worth keeping on: sampling is what turns 'a black cat' into 'a sleek obsidian feline'. |
| seed | INT | 420–4294967295 | — |
| keep_model_loaded | BOOLEAN | false | Keep the model in VRAM afterwards. Leave off when the same GPU has to run MiniMax-H3 video generation next. |
| optionsopt | H3_REWRITER_OPTIONS | — | |
| bypassopt | BOOLEAN | false | Hand 'prompt' straight to the output and run no model at all: nothing is downloaded, nothing is loaded, no VRAM is touched. This is what ComfyUI's own bypass (Ctrl+B) cannot do here - it only forwards a connected link, and every input this node writes from is a widget, so bypassing the node the usual way leaves the nodes downstream with nothing. The section outputs come back empty. |
| system_promptopt | STRING | Replace the whole assembled instruction with your own. 'detail', 'subjects' and the three keeps then stop applying -- they exist only to build the text this overrides. 'language' still applies on the Reducer, because there it is not part of this text at all: it is a second request made after yours has answered. The parsing still happens either way. Stripping shot markers and reference tags is right whatever the instruction over them says, so what your system prompt is handed is the cleaned scene, not the raw text. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| short_prompt | STRING | — |
| scene | STRING | The description with the scaffolding taken off and nothing else done to it -- no model has touched this. Wire it when the deterministic half is all you wanted: the prose of a prompt, with the field names, shot markers and reference tags gone. |