MiniMax H3 Loop User Input Enhancer ๐
Your H3 idea is a blob. This node rewrites it into something the plan node can read.
- llm_service_connector
- user_input
MiniMaxH3LoopPromptGenerator is picky about its input in a way that isn't obvious from the canvas. It wants a short setting paragraph naming who's on screen and where, plus one utterance per line as Name๏ผline if there's dialogue, and it'll spend an LLM pass hunting for that structure when it isn't there. MiniMaxH3LoopUserInputEnhancer does that structuring deliberately, upstream, where you can read it: rough draft in, one STRING out, wired straight into the loop node's user_input widget.
Do you actually need it?
Sometimes not. If you already write beats as ่ง่ฒ๏ผๅฐ่ฏ with one line per utterance, the loop node's deterministic parser recognises the format and skips its extraction call entirely - a saved LLM round-trip per run. The enhancer is for the other case: you have a paragraph, a vibe, a half-outline. It's also the honest answer to "why is my board narration when I clearly wrote dialogue?" The structure wasn't there to find.
What it's doing under the hood
One LLM call against whatever llm_service_connector you wire in, driven by a bundled system prompt with four branches: dialogue, action, narration, and reference-driven. It picks the dominant branch, then rewrites your draft into the canonical shape the loop node consumes - and the rules are stricter than the average text enhancer:
- Spatial layout is mandatory. The opening paragraph must state where every named subject sits ("A at left of frame, B at right"). Spatial drift between scene 1 and scene N is a top failure mode in chained generation - the character quietly changes sides and nothing in the graph catches it. If your draft doesn't say, the node infers a default and flags it for you to confirm.
- Dialogue is copied, never translated. English stays English, Chinese stays Chinese, no quotes, no leading verbs, one line per utterance, same speaker spelling everywhere. Mixed spellings invent a phantom speaker.
- Camera intent survives. Ask for a POV shot and the rewrite carries that line through instead of defaulting to a locked-off frame.
The reply has to contain a --- BEGIN user_input --- / --- END user_input --- block, with a Classification: line and one to three lines of "Notes for the user" above it. Without that block the node raises instead of passing the raw reply downstream - deliberate, and right: a misclassified rewrite silently flowing into a 20-minute H3 run is worse than a red error.
Inputs and the output
Real inputs: llm_service_connector, draft (your rough idea, any shape), category (none / dialogue / action), reference_mode, pacing, seed. Optional knobs are temperature (0.4 default - low enough that the branch classification stays stable), max_tokens (16384) and timeout.
category, reference_mode and pacing mirror the loop node's widgets, and you sync them by hand. The one that bites: with reference images, reference_mode must be fl2va or ref2va here and on the loop node. t2va ignores the image socket, so a mismatch means your reference images ride along in plan text and do nothing in the sampler.
The single output is user_input (STRING) - same name as the loop node's widget, so you drag it onto the input and you're done.
Install
Same pack, same two commands:
cd ComfyUI/custom_nodes
git clone https://github.com/MieMieeeee/ComfyUI-MieNodes
cd ComfyUI-MieNodes && pip install -r requirements.txt
ComfyUI Manager users can search ComfyUI_MieNodes instead. Nothing else to download - the prompts ship in the repo, and the only thing this node needs at runtime is a reachable LLM endpoint through one of the pack's connector nodes.
Where people get burned
- Small local models ignore the output contract. The BEGIN/END block is a format instruction, and an 8B model asked to classify, advise and rewrite in one pass will sometimes justโฆ not. The error includes the head of the raw reply, so you can see what it did instead. Bigger model, or structure the draft by hand.
- Reasoning models and the empty-reply bug. A thinking model counts its chain-of-thought against
max_tokens. At a tight budget you get an HTTP 200 with empty content - the classic symptom is 20โ30 seconds of "thinking" and then a parse failure. Leave the 16384 default alone unless you're paying per token. - An empty
draftgets you nothing useful. Unlike the loop node there's no default concept fallback here; you asked for a rewrite of nothing. - Read the notes. It restructures, it doesn't write your video. If the notes say the spatial layout was inferred, fix that one field before queueing - it's the field most likely to haunt you six scenes later.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| llm_service_connector | LLMServiceConnector | โ | |
| draft | STRING | Your rough idea in any shape โ a sentence, an outline, a few lines, a free paragraph. The preprocessor rewrites it into the format the H3 Loop Plan Generator node consumes. | |
| category | COMBO | none - ไธๆๅฎ | Mirrors the H3 Loop node's category widget. Sets the cinematography advice the preprocessor will respect (none / dialogue / action). |
| reference_mode | COMBO | t2va - ๆ็่ง้ข้พ(้ป่ฎค) | Mirrors the H3 Loop node's reference_mode widget. CRITICAL: if you have reference images, set this to fl2va or ref2va here AND on the loop node โ t2va ignores the images socket. |
| pacing | COMBO | normal - ๆญฃๅธธ๏ผ่ฏญ้ยทๆจ่๏ผ | Mirrors the H3 Loop node's pacing widget. The rewrite matches this tempo: fast -> more, shorter beats/dialogue lines with quick back-and-forth and dense chained action; normal -> default shaping; slow -> fewer, longer beats, calm unhurried action. |
| seed | INT | 00โ18446744073709550000 | Seed forwarded to the LLM call. 0 lets the connector pick a fresh seed. |
| temperatureopt | FLOAT | 0.400โ2 | โ |
| max_tokensopt | INT | 1638464โ32768 | โ |
| timeoutopt | COMBO | 300 | 4 options: 60, 120, 300, 600 |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| user_input | STRING | โ |