Nodes/ComfyUI_MieNodes/MiniMax H3 Prompt Generator ๐Ÿ‘
ComfyUI Node

MiniMax H3 Prompt Generator ๐Ÿ‘

Have an LLM write your Hailuo H3 prompt, complete with soundscape

By MieMieeeeeยทCreated 2 years agoยทUpdated 6 days agoยท 247
MiniMax H3 Prompt Generator ๐Ÿ‘
  • llm_service_connector
  • first_frame
  • last_frame
  • reference_images
  • reference_video
  • h3_prompt
โ—„task_typet2v - ๆ–‡็”Ÿ่ง†้ข‘โ–บ
โ—„user_promptโ–บ
โ—„seed0โ–บ
โ—„width1280โ–บ
โ—„height720โ–บ
โ—„duration6.0โ–บ
โ—„categorynone - ไธๆŒ‡ๅฎšโ–บ
โ—„output_languageenโ–บ
โ—„caption_sample_frames8โ–บ
โ—„image_detailautoโ–บ
โ—„temperature0.40โ–บ
โ—„max_tokens_caption4096โ–บ
โ—„max_tokens_enhance8192โ–บ
โ—„timeout120โ–บ

MiniMax H3 (Hailuo's current video model) is picky about prompts. It wants a structured, sectioned format - core idea, soundscape, music, "do not include" - and eyeballing that format from your rough idea is exactly the kind of task the community has decided an LLM should do for you. That's what this node is: you type "a fox runs through a neon Tokyo alley at night," it hands H3 back a properly structured prompt that would make the model's official writing guide nod approvingly.

It's the same pattern as the pack's Bernini and SCAIL-2 prompt generators, and it sits in the same category. The reasoning is straight out of the modern prompting playbook: if the model reads your prompt as a message, having a general-purpose LLM translate your idea into the model's preferred structure beats fighting the format yourself.

How it works

You give it a rough idea plus optional reference media, and it routes that through any of the pack's LLMServiceConnector nodes - MiniMax, DeepSeek, Gemini, SiliconFlow, whatever you've got a key for. The pipeline is two-stage, but only for the reference task: stage one captions the reference images or a sample of video frames so stage two knows what to preserve, then stage two writes the final structured prompt. Every other task path is single-stage, because H3's guide says describe the change, not the reference - so i2v tasks prepend an alignment directive and tell the model not to re-describe what's already visible in the image.

The output header gets built from a few simple fields: your width/height reduce to an aspect ratio string (1280x720 โ†’ "16:9"), duration goes into a timestamp directive, and category (19 use-case classes plus "none") injects default styling advice - cinematic-story adds color grading and a 35โ€“50mm note, action adds motion blur and shake. output_language flips the whole thing between English and Chinese, with the sensible exception that dialogue, lyrics, and on-screen text stay in their original language.

The inputs that matter

  • llm_service_connector - required. Wire in any Set*LLMServiceConnector node; without one this won't run.
  • task_type - one of six: t2v, i2v_first, i2v_first_last, i2v_last, reference, s2v. Pick the one matching how you'll generate.
  • user_prompt - your rough idea. Leave it blank and it synthesizes a default from the task and category, so you can run media-only.
  • seed - plus the usual sampling knobs (temperature, default 0.4, image_detail, timeout).

Media inputs are first_frame, last_frame, reference_images, and reference_video (an IMAGE batch, one tensor per frame). caption_sample_frames (default 8, max 16) controls how many reference-video frames get sampled for the stage-1 caption - more frames mean a more accurate caption but a slower, pricier call.

Output: one h3_prompt STRING. Feed it straight into the H3 video node's prompt input. That's the whole contract.

Installing

Same as the rest of the pack - Manager (search "ComfyUI_MieNodes") or:

cd ComfyUI/custom_nodes
git clone https://github.com/MieMieeeee/ComfyUI-MieNodes

No models to download. You do need an LLM API key: either type it into a connector node's api_token or drop a mie_llm_keys.json next to the README (copy the .example file) so keys stay out of your workflows. Free tiers exist on ZhiPu and SiliconFlow if you want to try it without paying.

Where people get burned

The number-one failure mode is an empty result logged as "H3 enhance: model returned empty." Per the source comments, the usual cause is a reasoning model - MiniMax-M3, DeepSeek-R1, GLM - burning the whole token budget on chain-of-thought before the answer. The budgets are already sized generously (4096 for the caption, 8192 for the enhance) to hold the think chain and the ~350โ€“800-word answer, but if you crank max_tokens down, that's what you'll hit.

Second trap: duration. This node happily accepts anything, but the downstream H3 video node only accepts 5/6/8/12/15 seconds - anything else makes that node error, not this one. Set it to one of those.

Two softer gotchas. Reference video arrives through ComfyUI's IMAGE port, which carries no audio, so describe any sound you want in user_prompt instead. And the node fails soft: missing media for your chosen task, an LLM error, or an unknown task code just returns your original prompt unchanged, so a bad run won't brick the workflow - it'll just hand H3 a lousy prompt. When that happens, look at the console log for the "H3 ... returned empty" line; that's where the diagnosis lives.

Category๐Ÿ‘ MieNodes/๐Ÿ‘ Prompt Generator

Inputs (19)

NameTypeDefaultDescription
llm_service_connectorLLMServiceConnectorโ€”
task_typeCOMBOt2v - ๆ–‡็”Ÿ่ง†้ข‘6 options: t2v - ๆ–‡็”Ÿ่ง†้ข‘, i2v_first - ๅ›พ็”Ÿ่ง†้ข‘(้ฆ–ๅธง), i2v_first_last - ๅ›พ็”Ÿ่ง†้ข‘(้ฆ–ๅฐพๅธง), i2v_last - ๅ›พ็”Ÿ่ง†้ข‘(ๅฐพๅธง), reference - ๅ…จ่ƒฝๅ‚่€ƒ, s2v - ไธปไฝ“ๅ‚่€ƒ
user_promptSTRINGโ€”
seedINT00โ€“18446744073709550000โ€”
first_frameoptIMAGEโ€”
last_frameoptIMAGEโ€”
reference_imagesoptIMAGEโ€”
reference_videooptIMAGEReference video for the 'reference' task, supplied as an IMAGE batch (one tensor per frame). caption_sample_frames of them are sampled evenly for the stage-1 caption. Audio references are not wired (ComfyUI IMAGE port carries no audio); describe audio inside user_prompt instead.
widthoptINT1280Output frame width in pixels. Together with height it defines the aspect ratio written into the prompt header (e.g. 1280x720 -> '16:9'). The downstream H3 video node sets the real render size.
heightoptINT720Output frame height in pixels. Together with width it defines the aspect ratio written into the prompt header (e.g. 720x1280 -> '9:16').
durationoptFLOAT6.0Target video duration in seconds (float). Written into the prompt header and the FL2VA/L2VA final-timestamp directive. NOTE: the downstream H3 video node only accepts 5/6/8/12/15s; other values will make the video node error, not this one.
categoryoptCOMBOnone - ไธๆŒ‡ๅฎšH3 use-case category. Adds default styling advice to the prompt (e.g. cinematic-story -> cinematic color grading + 35-50mm; action -> motion blur + shake). Does not change the task path. 'none' = no category-specific advice.
output_languageoptCOMBOenOutput language of the final H3 prompt. 'en' = English (default), 'zh' = Chinese. The section headers (Core idea / Soundscape / Music / Do not include) switch to the chosen language; the descriptive body is written in that language too. EXCEPTION: dialogue, lyrics, and visible on-screen text always stay in their original language.
caption_sample_framesoptINT81โ€“16Number of frames sampled evenly from reference_video for the stage-1 caption (reference task only). Higher = more accurate caption but slower and costlier; lower = faster but may miss motion. Does NOT set the output video length.
image_detailoptCOMBOauto3 options: auto, low, high
temperatureoptFLOAT0.400โ€“2โ€”
max_tokens_captionoptINT409664โ€“32768โ€”
max_tokens_enhanceoptINT819264โ€“32768โ€”
timeoutoptCOMBO1204 options: 30, 60, 120, 300

Outputs (1)

NameTypeDescription
h3_promptSTRINGโ€”