Nodes/comfyui-minimax-h3-prompt-enhancer-T8/MiniMax H3 Image Prompt Enhancer T8
ComfyUI Node

MiniMax H3 Image Prompt Enhancer T8

MiniMax H3 Image Doesn't Want Your Prompt, It Wants Its Official One

By T8mars·Created 4 months ago·Updated about 20 hours ago· 434
MiniMax H3 Image Prompt Enhancer T8
  • reference_images
  • provider_config
  • 扩写正文 / expanded_prompt
  • 画幅比例 / aspect_ratio
  • 官方结构 / official_json
  • 诊断报告 / report_json
◄prompt►
◄task_type文生图 / Text to image►
◄aspect_ratioauto►
◄target_words0►
◄api_mode贞贞平价小屋(推荐)►
◄api_key►
◄locked_text►
◄max_corrections1►
◄llm_max_tokens16384►
◄ai_workshop_modelgemini-3.5-flash►
◄custom_modelqwen/qwen3.8-flash-next►
◄openai_base_url►
◄seed0►
◄local_modelQwen3.8-27B-Q4_K_M.gguf►
◄local_mmprojAUTO(自动匹配)►
◄local_context_size32768►
◄local_max_tokens16384►
◄local_think_mode关闭(推荐,速度优先)►
◄local_reasoning_effortmedium►
◄local_unload_policy执行后卸载(推荐)►
◄local_comfy_memory_policyAUTO(显存不足时释放)►
◄recovery_slot►
◄recovery_actionnormal►
◄width0►
◄height0►

What this thing actually is

MiniMax H3 Image has its own prompt dialect. Not vibes - an actual published prompt-enhancement spec (MiniMaxAI/MiniMax-H3-Image-PE on Hugging Face), with different task instructions for text-to-image and for editing, one a 38 KB doc on how to interleave reference pictures and emit a two-field JSON answer. Writing that by hand is nobody's idea of fun.

This node does the translating. You write a normal brief - "a coffee poster, Chinese headline, warm morning light" - it runs MiniMax's own PE prompt through a chat LLM you pick, and hands back an expanded English caption plus a ratio. The official text is pinned at a fixed commit and hash-checked before every run, so you get MiniMax's instructions, not a paraphrase.

That distinction matters. Prompt-enhancer nodes are ten-a-penny now, and the usual failures are chat habits leaking into your conditioning ("Here is your enhanced prompt:", fences) and drift, where the model invents detail you never asked for. A pinned contract plus a verifier is the disciplined end of that spectrum.

How it works under the hood

Two code paths, one per task.

Text to image sends MiniMax's T2I system prompt plus its task prompt with your brief substituted in, then appends a separate T8 control block (ratio, word target, locked text) below the unchanged official text.

Image edit is the interesting one. References go in as ordered slots, each announced to the model as <Picture 1> with its real aspect ratio; your editing instruction is sent as a JSON string and the model must answer with one two-field JSON object. The node parses that strictly, checks the ratio and the locked strings, and allows one extra correction call if a complete answer botched the format. Network failures and truncations are never silently resent, and a failed check errors out rather than passing a bad draft downstream.

Nothing here generates pixels - the report literally records "image_generation_performed": false.

The inputs you'll actually touch

  • prompt - your brief. Multiline, and dynamic-prompt syntax is disabled, so {red|blue} reaches the model as literal braces rather than being randomized.
  • task_type - Text to image or Image edit. Get it wrong and it stops early: references in T2I mode is an error, so is Edit with no images.
  • aspect_ratio - auto by default. T2I only accepts the ten official ratios (1:1, 5:4, 4:3, 3:2, 16:9, 21:9, 4:5, 3:4, 2:3, 9:16); Edit accepts any positive W:H. Wire a resolution node's width and height INT outputs and it computes the ratio for you - but it does not resize anything downstream.
  • target_words - 0 means "let the official rules decide". A positive value is a soft English word target, not a token budget; it won't truncate or drop required facts to hit it.
  • locked_text (advanced) - one line per on-screen string you need verbatim, duplicates included. Prose stays English; your Chinese headline stays Chinese.
  • reference_images - autogrow, one image per slot, up to 16, in order.

Four outputs: expanded_prompt wires to your H3 image prompt input, aspect_ratio is a plain string, official_json is the raw two-field object. Leave report_json alone - it's diagnostics, definitely not a prompt.

Install

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

Restart ComfyUI, Ctrl+F5 the tab, then search MiniMax H3 Image Prompt Enhancer T8 in the node menu.

ComfyUI Manager works too - search MiniMax H3 / Seedance 2.0 / Music 3 Prompt Enhancer (T8) - but prefer updating from GitHub: a Registry build stuck in review can leave you on an older "Active" version while the UI swears it installed. Keep exactly one copy of the folder in custom_nodes. This pack uses modern node schema (io.ComfyNode, Autogrow sockets) and wants ComfyUI 0.33+; on older builds the node simply won't show up.

No model downloads. Cloud mode adds nothing beyond what ComfyUI already ships (requests, Pillow, NumPy). Local mode needs llama-cpp-python plus a GGUF in ComfyUI/models/LLM.

Where people get burned

The default provider is the author's own paid gateway (affiliate links all over the README), so "it needs an API key" is true out of the box. Point api_mode at an OpenAI-compatible endpoint or the local GGUF channel if you'd rather not.

The enhancer does not pass your pictures through. For editing you must wire the same images, in the same order, to the downstream H3 node - otherwise the caption is describing <Picture 2> while your H3 sees something else.

Batch images don't work. One image per slot; split batches first, or it stops with a slot error.

Local edit needs a vision projector. The visual projector defaults to AUTO, but with no mmproj installed the edit path can't see your references. The official edit instruction alone is 38 KB, so budget context for it plus every image plus the output. It errors rather than dropping images to fit - correct, and annoying.

Word count is not a truncation guarantee. H3 image downstream has a 4096-token text boundary and the node doesn't run a matching tokenizer, which is why the report marks it unverified. Short of the word target is much safer than "as long as possible".

CategoryT8/H3 Image

Inputs (27)

NameTypeDefaultDescription
promptSTRING—
task_typeCOMBO文生图 / Text to image2 options: 文生图 / Text to image, 图像编辑 / Image edit
aspect_ratioSTRINGautoOptional width + height inputs take priority and compute the ratio. T2I maps to the closest official ratio; Edit preserves exact reduced W:H. With no dimensions: auto or a supported ratio. Does not resize downstream images.
target_wordsINT00–9007199254740991Approximate caption word target, not Tokens. No 1000 ceiling; never truncates or omits fixed facts to meet a length.
api_modeCOMBO贞贞平价小屋(推荐)5 options: 贞贞平价小屋(推荐), 贞贞的AI工坊(图片/视频), OpenAI兼容接口(备用), 本地 GGUF(llama.cpp / Qwen,离线), Strata 本地服务(桥接)
reference_imagesoptCOMFY_AUTOGROW_V3—
api_keyoptSTRING—
provider_configoptT8_LLM_PROVIDER_CONFIG—
locked_textoptSTRING—
max_correctionsoptINT10–1—
llm_max_tokensoptINT16384256–65536—
ai_workshop_modeloptCOMBOgemini-3.5-flash2 options: gemini-3.5-flash, Custom(自定义)
custom_modeloptSTRINGqwen/qwen3.8-flash-next—
openai_base_urloptSTRING—
seedoptINT00–4294967295—
local_modeloptCOMBOQwen3.8-27B-Q4_K_M.gguf1 options: Qwen3.8-27B-Q4_K_M.gguf
local_mmprojoptCOMBOAUTO(自动匹配)2 options: AUTO(自动匹配), mmproj-F16.gguf
local_context_sizeoptINT327688192–65536—
local_max_tokensoptINT16384256–61440—
local_think_modeoptCOMBO关闭(推荐,速度优先)2 options: 关闭(推荐,速度优先), 开启(质量优先)
local_reasoning_effortoptCOMBOmedium3 options: low, medium, xhigh
local_unload_policyoptCOMBO执行后卸载(推荐)3 options: 执行后卸载(推荐), 保持驻留, 空闲10分钟后卸载
local_comfy_memory_policyoptCOMBOAUTO(显存不足时释放)2 options: AUTO(显存不足时释放), 不主动释放 ComfyUI 模型
recovery_slotoptSTRING—
recovery_actionoptSTRINGnormal—
widthoptINT00–9007199254740991Connect with height to compute aspect ratio. 0/0 keeps the existing ratio setting.
heightoptINT00–9007199254740991Connect with width to compute aspect ratio; neither input changes downstream pixel dimensions.

Outputs (4)

NameTypeDescription
扩写正文 / expanded_promptSTRING—
画幅比例 / aspect_ratioSTRING—
官方结构 / official_jsonSTRING—
诊断报告 / report_jsonSTRING—