MiniMax H3 Prompt Semantic Contract Audit / 提示词语义合同审计 (Advanced/T8)
Stop your prompt rewriter from quietly changing the scene
- safe_prompt
- candidate_prompt
- mechanical_pass
- decision
- report_json
Here's the failure this node exists to catch: you run your prompt through an LLM rewriter, it "improves" the wording, and somewhere in the rewrite the character stops rotating and starts standing still. The picture changes, the dialogue is subtly reworded, a <Video 2> tag disappears. Nobody noticed until the render is done. The Prompt Semantic Contract Audit is a gate you can put between a candidate rewrite and your H3 pipeline, and it refuses to let a mechanical check be the final word.
The contract is a small JSON you write once. It declares required_groups (at least one of these phrases must survive: ["turns", "turning", "rotates", "spins", "转身", "旋转"]) and forbidden_groups (none of these may appear: "stands still", "静止不动"). Each group needs an id, an any_of phrase list, and a scope - full, integrated, soundscape, or music - so you can scope a motion requirement to the video side and a dialogue requirement to the audio side. The node checks the candidate against those groups, plus exact dialogue blocks and media tags.
What it does not do is claim the candidate means the same thing. The README is blunt: phrase-level PASS is not semantic equivalence, and a known real-world regression where a provider turned "旋转" (rotate) into "站立" (stand) gets rejected and the original kept. Empty anchor phrases always return ABSTAIN.
The inputs that matter
original_promptandcandidate_prompt- the before and after. Multiline.semantic_contract_json- the JSON above. Strict; malformed JSON fails closed.accept_candidate_after_review- defaultfalse. This is the human-in-the-loop bit: even a mechanical pass doesn't switch the output until you flip this. The node defaults to passing through the original prompt.preserve_exact_dialogue,preserve_source_media_tags,allow_new_media_tags- your policy knobs for<d>...</d>dialogue blocks and<Picture N>/<Video N>/<Audio N>tags.
Outputs: safe_prompt (what you should actually feed H3), candidate_prompt, mechanical_pass (boolean), decision (pass/ABSTAIN/fail-closed), and report_json.
When it's worth the setup
If you hand-write your H3 prompts and never touch an LLM, skip this. If you're on the pack's prompt-relay/rewriter path - especially with a remote provider like OpenAI, LM Studio, or Ollama where you don't control the model's temperament - the contract audit is the safety net. It's cheap, fully local string logic, no model loading, so it doesn't cost you VRAM or GPU time. The pattern is deliberate: the author treats a rewrite as a candidate, never a replacement, until a person reviews it. You'll want to wire safe_prompt into your conditioning and eyeball decision before you accept anything.
Install and gotchas
Same pack as everything else here - MiniMax H3 Audio T8 from ComfyUI Manager ("MiniMax H3 Audio T8") or:
cd ComfyUI/custom_nodes
git clone https://github.com/T8mars/comfyui-minimax-h3-audio-T8
No extra pip deps for this node; it's pure string analysis. The main gotchas are contract-authoring mistakes: an empty any_of list ABSTAINs, invalid scope values fail closed, and if your original already contains a forbidden phrase, you'll get a rejection that's technically correct and annoying. Test your contract on the original prompt first so you know your baseline.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| original_prompt | STRING | — | |
| candidate_prompt | STRING | — | |
| semantic_contract_json | STRING | { "required_groups": [ {"id": "turn_motion", "any_of": ["turns", "turning", "rotates", "spins", "转身", "旋转"], "scope": "integrated"} ], "forbidden_groups": [ {"id": "stillness", "any_of": ["stands still", "motionless", "静止不动"], "scope": "integrated"} ] } | Strict local JSON. Each group requires id, any_of and scope. Scope is full, integrated, soundscape or music. Empty anchors always ABSTAIN. |
| accept_candidate_after_review | BOOLEAN | false | — |
| preserve_exact_dialogue | BOOLEAN | true | — |
| preserve_source_media_tags | BOOLEAN | true | — |
| allow_new_media_tags | BOOLEAN | true | — |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| safe_prompt | STRING | — |
| candidate_prompt | STRING | — |
| mechanical_pass | BOOLEAN | — |
| decision | STRING | — |
| report_json | STRING | — |