Nodes/MiniMax H3 Audio T8/MiniMax H3 Prompt Budget + Role Compiler / 提示词预算与角色编译 (Advanced/T8)
ComfyUI Node

MiniMax H3 Prompt Budget + Role Compiler / 提示词预算与角色编译 (Advanced/T8)

The 7000-character reality check your H3 prompt needs before you queue it

By T8mars·Created 20 days ago·Updated a day ago· 807
MiniMax H3 Prompt Budget + Role Compiler / 提示词预算与角色编译 (Advanced/T8)
  • clip
  • compiled_prompt
  • pass_audit
  • decision
  • character_count
  • estimated_token_count
  • exact_token_count
  • media_map_json
  • report_json
prompt
character_limit7000
token_limit0
picture_count0
video_count0
audio_count0
media_assignments_json{"subjects":[{"subject_id":"lead","picture_ordinal":1,"audio_ordinal":1,"role":"primary_character"}]}
append_role_bindingstrue
allow_shared_audiofalse
require_exact_token_countfalse

MiniMax H3's official CLI enforces a 7000-character submission ceiling, and if you're building elaborate multi-character prompts with <Picture N> and <Audio N> media tags, you will blow past it without noticing. MiniMaxH3PromptBudgetCompilerT8Advanced is the node that audits your prompt against that budget before you waste a render - and it does it with the one quality you'd actually want from a budget tool: it never truncates anything.

The author's framing here is unusually precise, and it's worth absorbing. The 7000 default character_limit matches the current official H3 CLI submission rule, but the tooltip is explicit that this is not a detected hard limit of the local open-weight tokenizer. Raise the limit and you opt out of official-submission compatibility - the report warns you, but the prompt passes through untouched. That honesty extends to the whitespace: the README brags, correctly, that the compiler won't silently strip even leading or trailing whitespace from your prompt. What you type is what gets audited.

What it audits

Beyond raw character count, it checks token budget (via an optional CLIP - connect one for real exact counts), the count and order of your media tags (<Picture>/<Video>/<Audio>), and - the interesting part - your subject-to-media bindings. You declare the cast in media_assignments_json:

{"subjects":[{"subject_id":"lead","picture_ordinal":1,"audio_ordinal":1,"role":"primary_character"}]}

and the compiler verifies that every declared subject actually has its picture and audio ordinals covered by the prompt's tags. append_role_bindings (on by default) adds those role bindings to the compiled prompt; allow_shared_audio is off by default, meaning two subjects can't silently share one audio track unless you say so. There's even require_exact_token_count if you need the token count to be exact rather than estimated.

The outputs that matter

  • compiled_prompt - your prompt, passed through with bindings appended.
  • pass_audit (BOOLEAN) and decision - wire pass_audit into a gate if you want to hard-stop on failure.
  • character_count, estimated_token_count, exact_token_count - the three numbers you actually care about.
  • media_map_json and report_json - the machine-readable and human-readable breakdowns.

The author's real-world numbers: 7000/7001 boundary tested, three-person mappings tested, and a real Qwen3-VL 8B compiled text came in at 140 tokens with a planning estimate of 153. The report also notes that current ComfyUI has no 7000-character hard block - so this node is deliberately not pretending API/CLI rules are a local tokenizer hard limit.

Where it fits

Think of it as the gate before the gate: compile and audit your prompt, then feed the result toward the Studio Prompt Compiler or straight into conditioning. It's the "did I actually assign every character a voice" insurance policy for multi-character scenes - the failure mode it catches (a character whose audio tag points at the wrong ordinal) is exactly the kind of thing that otherwise shows up as mysteriously wrong dialogue 20 minutes into a render.

Install

Part of the MiniMax H3 Audio T8 pack - Manager search "MiniMax H3 Audio T8", or:

cd ComfyUI/custom_nodes
git clone https://github.com/T8mars/comfyui-minimax-h3-audio-T8

Restart. No pip deps, no model downloads; it runs happily on an empty machine. The example workflow is examples/workflows/14-prompt-relay/2026-08-22_H3_Prompt_Budget_Role_Compiler_Advanced.json.

CategoryT8/MiniMax H3/Prompt/Advanced

Inputs (11)

NameTypeDefaultDescription
promptSTRING
character_limitINT70001–1000000Default 7000 matches the current official MiniMax H3 CLI submission limit. It is not a detected hard limit of the local open-weight tokenizer. Raising it opts out of official submission compatibility; the report warns and the prompt is never truncated.
token_limitINT00–10000000 reports token counts without applying a token ceiling.
picture_countINT00–99
video_countINT00–99
audio_countINT00–99
media_assignments_jsonSTRING{"subjects":[{"subject_id":"lead","picture_ordinal":1,"audio_ordinal":1,"role":"primary_character"}]}
append_role_bindingsBOOLEANtrue
allow_shared_audioBOOLEANfalse
require_exact_token_countBOOLEANfalse
clipoptCLIP

Outputs (8)

NameTypeDescription
compiled_promptSTRING
pass_auditBOOLEAN
decisionSTRING
character_countINT
estimated_token_countINT
exact_token_countINT
media_map_jsonSTRING
report_jsonSTRING