MiniMax-H3-Image-PE: Turn Short Prompts into Detailed Captions
MiniMax-H3-Image-PE is the prompt expansion model for MiniMax-H3-Image. It turns a short request into a detailed English caption plus an aspect-ratio recommendation, with a JSON output contract for text-to-image and editing workflows. This guide covers its Qwen3.8-27B base, FP4 deployment, SGLang and Diffusers commands, and what is still under development.
View 2 referencesAllow the functional cookie to save your likes. Privacy details
What is MiniMax-H3-Image-PE?
MiniMax-H3-Image-PE is a prompt expansion model built for MiniMax-H3-Image. It turns a short image request into a detailed English description and an aspect-ratio recommendation, then returns both as structured JSON. It is an optional step, not a requirement for generating images.
The model is a 27B-parameter fine-tune of Qwen/Qwen3.8-27B, released in FP4, and is published by MiniMax on Hugging Face. According to the model card, it is meant to sit in front of image generation so that a one-line instruction becomes a caption a diffusion model can act on. The underlying Qwen model is Apache 2.0, but MiniMax-H3-Image-PE itself uses the MiniMax-H3-Image community licence.
What does the prompt expander actually output?
For text-to-image, MiniMax-H3-Image-PE returns a JSON object with an expanded_caption and an aspect_ratio. The caption is a fuller version of your request, and the ratio is a recommendation such as 3:2. A fixed seed makes it easier to compare captions across prompt edits.
A model-card example takes the input An orange tabby cat sleeping on a sunlit windowsill. and produces a warm descriptive caption about afternoon light plus an aspect_ratio of 3:2. The text-to-image release includes task prompts, a system prompt, request parameters, and a client script. Default request parameters are temperature 1.0, top_p 0.95, top_k 20, max_tokens 4096, reasoning_effort xhigh, and thinking enabled, with a JSON schema constraining the response.
How do aspect-ratio recommendations work?
MiniMax-H3-Image-PE suggests an aspect ratio only when the downstream image generator is set to auto. If you explicitly choose a ratio, the image generator uses your choice instead of the model's recommendation. This rule keeps deliberate framing decisions under your control.
That rule prevents the expander from overriding deliberate framing decisions. In the image-editing workflow the output field is named target_aspect_ratio. If the user picks adaptive, the model determines a positive-integer W:H ratio; if the user supplies an explicit ratio such as 16:9, the model preserves it. Literal text in a request stays in the user's language while the descriptive caption is written in English.
Is image-editing prompt expansion ready?
Partly. MiniMax says image-editing PE is still under development and that this release provides the prompt only, not finished weights for that workflow. If you need finished editing expansion today, you must wire your own vision-language model to the published prompt.
For editing, the repository supplies prompt/edit/task_prompt.txt and a documented way to assemble a message with reference images, their original aspect ratios, the edit instruction, and a ratio selection. The task prompt is loaded verbatim as the first content part so that a provider with prefix caching can reuse it. The intended use is a vision-language model that supports interleaved text and images; MiniMax does not pick a specific model or make the API call for you.
How do you deploy MiniMax-H3-Image-PE with SGLang?
The recommended serving path is SGLang with XGrammar constraining output to the JSON schema. Serve the model under the name MiniMax-H3-Image-PE and use the qwen3 reasoning parser. Keep the server local and validate the schema before sending requests from a production client.
sglang serve \
--model-path MiniMaxAI/MiniMax-H3-Image-PE \
--served-model-name MiniMax-H3-Image-PE \
--model-type llm \
--reasoning-parser qwen3 \
--grammar-backend xgrammar \
--constrained-json-disable-any-whitespace \
--host 0.0.0.0 \
--port 30000
Run the example from a local copy of the repository so the relative prompt and script paths resolve. The client script takes the server URL, model name, and your short request, then validates the response against the schema.
How do you run the Diffusers modular pipeline?
MiniMax also publishes diffusers/minimax-h3-image-pe-blocks, a modular pipeline that wraps the prompts, request parameters, and XGrammar constraint. It is the simplest way to test the expander locally. Start with the wrapped blocks before working with the raw prompt files and relative paths.
import torch
from diffusers import ModularPipeline
pe = ModularPipeline.from_pretrained(
'diffusers/minimax-h3-image-pe-blocks',
trust_remote_code=True,
)
pe.load_components(dtype=torch.bfloat16, device_map='cuda')
state = pe(prompt='An orange tabby cat sleeping on a sunlit windowsill.')
print(state.get('prompt'), state.get('aspect_ratio'))
The FP4 weights stay in 4-bit and use about 19 GiB of GPU memory. GPUs with native FP4 support run NVFP4 weights directly; other GPUs use bitsandbytes FP4. Activations are bf16, so Diffusers output is not token-for-token identical to SGLang output. Passing an image argument switches the pipeline to the editing PE path.
What are the licence and hardware requirements?
MiniMax-H3-Image-PE uses the MiniMax-H3-Image community licence, which requires separate written authorisation from MiniMax if your annualised revenue exceeds one million US dollars or if you provide hosted services to third parties. Budget for roughly 19 GiB of GPU memory before you commit.
Budget roughly 19 GiB of GPU memory for the local pipeline. You also need a local repository copy for the raw prompt files, unless you use the wrapped Diffusers blocks. No inference provider is listed on the model page, so self-hosting or the MiniMax API are the practical routes. Check the current licence text before shipping a commercial product.
FAQ
These questions cover the decisions that come up before adding MiniMax-H3-Image-PE to a pipeline: whether it is required, whether it works with other generators and how it handles non-English requests. Answers come from the official model card. Check the licence before any commercial use.
Do I need MiniMax-H3-Image-PE to use MiniMax-H3-Image?
No. MiniMax describes the expander as optional and recommends it for best results. You can send a plain prompt to the image model directly and only add the PE step when you want more consistent captions and framing.
Can I use the expander with other image models?
The JSON caption contract is model-agnostic in principle, but the prompts and parameters are tuned for MiniMax-H3-Image. Using the output with another generator may work, but you should validate the caption style and aspect ratio on your own pipeline.
Does the expander support non-English input?
Yes for the instruction: the model can expand a short request and preserve literal text in the user's language. The descriptive caption itself is written in English, which matters if your downstream generator is stronger in English.