Nodes/MiniMax H3 Context IR - leoleexh/MiniMax H3 Context IR (OpenAI) - leoleexh
ComfyUI Node

MiniMax H3 Context IR (OpenAI) - leoleexh

Make MiniMax H3 obey your prompt — and stop breaking the media tags

By leoleelxh·Created about a month ago·Updated 11 days ago· 3
MiniMax H3 Context IR (OpenAI) - leoleexh
  • creative_profile
  • first_frame
  • last_frame
  • ref_images
  • ref_videos
  • ref_video_audios
  • ref_audios
  • h3_prompt
  • context_ir_json
  • analysis_report
  • warnings
  • usage_json
user_prompt
modeauto
width
height
length
model_presetgpt-5.6-sol
custom_model
api_key
base_urlhttps://api.openai.com/v1
api_modeauto
reasoning_effortmedium
output_languageen
strictnessbalanced
generate_background_musictrue
generate_dialoguetrue
generate_subtitlesfalse
privacy_modecloud
cache_enabledtrue
max_visual_inputs40
max_video_frames32
transcription_modelgpt-4o-transcribe
timeout_seconds120
max_retries2
generate_narrationfalse
dialogue_languageauto

MiniMax H3 is the open-weights model that finally gave Veo's audio advantage a local answer: a 33B omni-modal generator with native synced stereo sound, which landed #1 in video-editing-with-audio on Artificial Analysis within days of its August 2026 drop. The catch is the prompt format. Native H3 nodes want <Picture N>, <Video N>, <Audio N> tags that line up exactly with the media you plug into conditioning, a laid-out shot timeline, and dialogue in the (S1) says <d>[Chinese] 台词</d> shape. Plain prose mostly works. Prose plus a pile of reference media is where it falls apart - the numbers drift, tags go stale, and the model starts ignoring half your references.

M3H3ContextIROpenAI_leoleexh (listed as "MiniMax H3 Context IR (OpenAI) - leoleexh") is a prompt preprocessor built for that exact problem. It's the flagship node of the ComfyUI-M3-IRContext pack, and it does what a generic LLM prompt-polisher can't: it actually looks at your images, video frames, and audio, then renders a valid H3 Base three-section or Ref2VA six-section prompt that matches what you wired into the native node.

How it works

The design is deliberately defensive. First it builds an immutable local media registry - each image is analyzed separately, the single reference video is sampled at about 2 fps from the timeline prefix native generation actually uses (hard cap 32 frames), and audio gets a 16 kHz mono copy made for transcription. Every still and sample frame is re-encoded locally as a JPEG (max side 1024px, under 100KB) before anything goes out. Then it asks an OpenAI-compatible model for a strict JSON plan, using the Responses API first and falling back to Chat Completions only when the endpoint doesn't support Responses. That plan is validated locally against asset IDs, tags, subjects, verbatim dialogue, timeline, and target duration - with one automatic repair pass if it misses. The final prompt render happens locally, which means the model can't control physical input numbering or invent tags.

The inputs that matter

  • user_prompt - your natural-language intent. she says: Hello. English dialogue is converted to proper H3 dialogue automatically.
  • width, height, length - direct INT sockets. Branch these from the same Resolution Selector and duration Math Expression you feed native H3; the node plans its shot timing from length / 24, so prompt pacing and generation share one source of truth and never drift.
  • api_key, base_url, model_preset - the connection. Default model is gpt-5.6-sol; custom_model takes any compatible ID. Leave the key blank and use H3_CONTEXT_API_KEY (or OPENAI_API_KEY) env vars.
  • privacy_mode - cloud sends media derivatives and text to the endpoint; local_only uploads nothing but only outputs a conservative template.
  • generate_background_music, generate_dialogue, dialogue_language, generate_narration, generate_subtitles - the generation toggles, all with sensible H3-native defaults.
  • max_visual_inputs (default 40) and max_video_frames (default 32) - the cloud-analysis budget.

Media goes in via first_frame, last_frame, ref_images (up to 9), one ref_videos, a paired ref_video_audios, and ref_audios (3). mode: auto picks T2VA, I2VA, L2VA, FL2VA, or Ref2VA from whatever's connected - note first/last frame and ref_* inputs are mutually exclusive. There's also an optional creative_profile input fed by the pack's Creative Director node.

Outputs

h3_prompt is the one that matters - wire it into the native H3 node's prompt. The rest are diagnostics: context_ir_json (full validated plan), analysis_report, warnings, and usage_json (tokens, latency, cache hits - no keys).

Install

It's a light API node: the entire dependency list is openai>=1.74.0, no model downloads.

cd ComfyUI/custom_nodes
git clone https://github.com/leoleelxh/ComfyUI-M3-IRContext.git
python -m pip install -r ComfyUI-M3-IRContext/requirements.txt

Restart ComfyUI and you'll find all three nodes under leoleexh/MiniMax H3. ComfyUI Manager can install it too.

Where people get burned

  • The key is saved in the workflow. ComfyUI's string widget shows it and may serialize it into workflow JSON. Never share a workflow or screenshot with a real key - set the env var instead.
  • Media must go to native H3 too. This node doesn't produce conditioning and doesn't forward media. Connect every image/video/audio to both this preprocessor and the native H3 node, in the same order. That's the classic "H3 sees nothing" mistake.
  • Not every "OpenAI-compatible" endpoint works. Cloud mode needs vision, strict JSON Schema output, and (for audio) a transcription endpoint. Missing capabilities fail explicitly rather than fabricate output.
  • The H3 weights themselves are license-geofenced - the MiniMax H3 Community License excludes the US, EU, UK, and South Korea, so this node is only useful if you're in a territory where running the local weights is legal for you.

With VideoHelperSuite, set force_rate=24 and select_every_nth=1 on VHS Load Video and branch the IMAGE output to both ref_video_1 ports. Don't use meta_batch streaming - the preprocessor won't stitch chunks across runs.

Categoryleoleexh/MiniMax H3

Inputs (32)

NameTypeDefaultDescription
user_promptSTRINGOriginal intent in natural language. Common forms such as `she says: Hello. English dialogue` are converted automatically; explicit <d>[Language] text</d> is also supported.
modeCOMBOauto6 options: auto, t2va, i2va, fl2va, l2va, ref2va
widthINTConnect the same width INT used by the native H3 node, normally from the official Resolution Selector.
heightINTConnect the same height INT used by the native H3 node, normally from the official Resolution Selector.
lengthINTConnect the exact same H3-aligned frame-count INT used by the native H3 node. In the official workflow this is the integer output of the duration Math Expression.
model_presetCOMBOgpt-5.6-sol5 options: gpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna, gpt-5.5, custom
custom_modelSTRINGUsed when model_preset is custom. Any compatible provider model ID is accepted.
api_keySTRINGType the key here, or leave blank to use an environment variable. ComfyUI's standard string widget shows this value and may save it in workflow JSON. Never share a workflow or screenshot containing a real key.
base_urlSTRINGhttps://api.openai.com/v1OpenAI-compatible API base URL. This is stored in workflow JSON; never put a key here.
api_modeCOMBOautoAuto tries Responses first and falls back only when the endpoint does not implement it.
reasoning_effortCOMBOmedium3 options: low, medium, high
output_languageCOMBOen3 options: en, zh, auto
strictnessCOMBObalanced3 options: conservative, balanced, creative
generate_background_musicBOOLEANtrueON asks for a fitting non-diegetic score unless the user explicitly requests no music. OFF forces the final prompt to prohibit background music.
generate_dialogueBOOLEANtrueON allows natural dialogue when the scene supports it and preserves extracted or explicit lines. OFF forces no character dialogue or vocal performance. Narration is controlled separately.
generate_subtitlesBOOLEANfalseON asks H3 to burn in synchronized subtitles for actual dialogue. OFF prohibits dialogue captions. Generated-video text may still be imperfect.
privacy_modeCOMBOcloudCloud sends selected media derivatives/audio/text to the endpoint. local_only uploads nothing.
cache_enabledBOOLEANtrue
max_visual_inputsINT401–64Global cloud-analysis budget: still images count as 1 each; the remaining slots are used for timestamped sampled frames from the single reference video. It must be at least the number of connected visual assets.
max_video_framesINT322–32Hard cap for AI video frames. Actual sampling is adaptive at about 2 fps and is also limited by max_visual_inputs; the full frame batch is never uploaded.
transcription_modelSTRINGgpt-4o-transcribe
timeout_secondsINT12010–900
max_retriesINT20–6
generate_narrationBOOLEANfalseOFF prohibits narration, voice-over, spoken descriptions, and reading prompt text aloud. ON only permits narration when the user_prompt explicitly requests it.
dialogue_languageCOMBOautoAuto only permits context-appropriate dialogue. Selecting a language requires cloud planning to author at least one line in that language. Natural input such as `她说:你好。中文对白` is converted automatically; explicit <d>[Language] ...</d> also remains supported.
creative_profileoptM3_CREATIVE_PROFILEOptional connection from MiniMax H3 Creative Director. The structured profile is expanded against this node's exact duration, aspect ratio, mode, and connected references.
first_frameoptIMAGE
last_frameoptIMAGE
ref_imagesoptCOMFY_AUTOGROW_V3
ref_videosoptCOMFY_AUTOGROW_V3
ref_video_audiosoptCOMFY_AUTOGROW_V3
ref_audiosoptCOMFY_AUTOGROW_V3

Outputs (5)

NameTypeDescription
h3_promptSTRING
context_ir_jsonSTRING
analysis_reportSTRING
warningsSTRING
usage_jsonSTRING