Nodes/MiniMax H3 Audio T8/MiniMax H3 Prompt Semantic Contract Audit / 提示词语义合同审计 (Advanced/T8)
ComfyUI Node

MiniMax H3 Prompt Semantic Contract Audit / 提示词语义合同审计 (Advanced/T8)

Stop your prompt rewriter from quietly changing the scene

By T8mars·Created 20 days ago·Updated a day ago· 807
MiniMax H3 Prompt Semantic Contract Audit / 提示词语义合同审计 (Advanced/T8)
    • safe_prompt
    • candidate_prompt
    • mechanical_pass
    • decision
    • report_json
    original_prompt
    candidate_prompt
    semantic_contract_json{ "required_groups": [ {"id": "turn_motion", "any_of": ["turns", "turning", "rotates", "spins", "转身", "旋转"], "scope": "integrated"} ], "forbidden_groups": [ {"id": "stillness", "any_of": ["stands still", "motionless", "静止不动"], "scope": "integrated"} ] }
    accept_candidate_after_reviewfalse
    preserve_exact_dialoguetrue
    preserve_source_media_tagstrue
    allow_new_media_tagstrue

    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_prompt and candidate_prompt - the before and after. Multiline.
    • semantic_contract_json - the JSON above. Strict; malformed JSON fails closed.
    • accept_candidate_after_review - default false. 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.

    CategoryT8/MiniMax H3/Prompt/Advanced

    Inputs (7)

    NameTypeDefaultDescription
    original_promptSTRING
    candidate_promptSTRING
    semantic_contract_jsonSTRING{ "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_reviewBOOLEANfalse
    preserve_exact_dialogueBOOLEANtrue
    preserve_source_media_tagsBOOLEANtrue
    allow_new_media_tagsBOOLEANtrue

    Outputs (5)

    NameTypeDescription
    safe_promptSTRING
    candidate_promptSTRING
    mechanical_passBOOLEAN
    decisionSTRING
    report_jsonSTRING