Use AIUnderstand AIBuild with AI
Build with AI·Model deep dive·· 4 min read

Run MiniMax-H3-Image for 16-Megapixel Text-to-Image and Editing

MiniMax-H3-Image generates and edits images up to about 16 MP in 6 sampling steps. Serve it with vLLM-Omni or SGLang and call its image endpoints.

The code in this post comes from the model's docs and hasn't been run in our CI yet. If something breaks, let us know.

MiniMax-H3-Image is an open-weights image model from MiniMax that does text-to-image and image editing in one checkpoint. It comes from the MiniMax H3 family. What makes it notable is output size: it generates images of about 16 megapixels (for example 4096x4096) directly, with no upscaler, in 6 sampling steps.

Key specs

Task Text-to-image and image editing (up to 16 reference images)
Diffusion transformer 33.1B parameters, dense, 50 layers, BF16 weights
Text encoder The MiniMax-H3 Qwen3-VL text encoder, unchanged, stored in the MiniMaxAI/MiniMax-H3 repo
Sampling Distilled to 6 steps, no classifier-free guidance
Working range About 4 MP to 20 MP; best results around 16 MP
Prompt length Truncated to 4096 tokens
Optional prompt expander MiniMax-H3-Image-PE (NVFP4, 17.9 GB)
License MiniMax-H3-Image Community License Agreement

The card says the model “expects a detailed English description of the whole image”. MiniMax’s API turns short prompts into such descriptions with a service called H3-Image-Context-IR. If you run locally, the card points to the optional PE model for the same job.

Install

Download the model and the text encoder into the Hugging Face cache. The text encoder is not in the image repository, and you don’t download it twice if you already have MiniMax-H3.

Terminal window
hf download MiniMaxAI/MiniMax-H3-Image
hf download MiniMaxAI/MiniMax-H3 --include "text_encoder/*"

The card recommends SGLang, vLLM-Omni, diffusers and ComfyUI for running it. The examples below use the two servers whose commands the card shows.

Run it

Start a server on one GPU with SGLang:

Terminal window
sglang serve --model-path MiniMaxAI/MiniMax-H3-Image --host 0.0.0.0 --port 30000 --warmup-mode off

Or with vLLM-Omni (port 8000):

Terminal window
vllm serve MiniMaxAI/MiniMax-H3-Image --omni --host 0.0.0.0 --port 8000

To lower latency, the card splits each request across GPUs. On 4 GPUs that is --num-gpus 4 --ulysses-degree 4 for SGLang, or --num-gpus 4 --usp 4 --text-encoder-tp-size 4 for vLLM-Omni.

Text-to-image

Text-to-image requests are JSON sent to /v1/images/generations. The response holds the PNG in data[0].b64_json. This script uses only the standard library and assumes the SGLang server above.

t2i.py
import base64
import json
import urllib.request
prompt = (
"An overhead photograph of a farm-to-table feast on a weathered wooden table: "
"a loaf of crusty bread, fresh vegetables and several cheeses, "
"soft natural daylight, shallow shadows."
)
payload = {
"prompt": prompt,
"size": "4736x3552", # 4:3, one of the 16 MP sizes in the card
"seed": 42,
"generator_device": "cpu",
"response_format": "b64_json",
}
req = urllib.request.Request(
"http://localhost:30000/v1/images/generations",
data=json.dumps(payload).encode(),
headers={"Content-Type": "application/json"},
)
with urllib.request.urlopen(req) as resp:
data = json.load(resp)
with open("t2i.png", "wb") as f:
f.write(base64.b64decode(data["data"][0]["b64_json"]))

size is required and the returned image has exactly that size. seed and generator_device: "cpu" are recommended, so the same seed gives the same starting noise on every machine. The card lists these 16 MP sizes: 4096x4096 (1:1), 4736x3552 / 3552x4736 (4:3 / 3:4), 5024x3360 / 3360x5024 (3:2 / 2:3), 5472x3072 / 3072x5472 (16:9 / 9:16) and 6272x2688 (21:9).

Edit an image

Editing sends the reference images as multipart form data to /v1/images/edits. The upload order defines <Picture 1>, <Picture 2> and so on, and you refer to them in the prompt. Here is a curl call using the fields from the card’s parameter table:

Terminal window
curl http://localhost:30000/v1/images/edits \
-F "prompt=Remove the headphones from the man in <Picture 1>. Keep everything else the same." \
-F "size=4096x4096" \
-F "seed=42" \
-F "generator_device=cpu" \
-F "response_format=b64_json" \
-F "image=@reference1.png" \
-o edit.json

The PNG comes back base64-encoded in data[0].b64_json of edit.json. The card says the model supports up to 16 reference images, and its showcase includes composing an empty room and nine furniture images into one scene.

Gotchas

  • Large downloads. The card lists 66.28 GB for the transformer, 2.34 GB for the VAE and 66.7 GB for the text encoder.
  • Fixed sampling settings. num_inference_steps must be omitted or 6, and guidance_scale must be omitted or 1. Other values return HTTP 400. negative_prompt is rejected.
  • Small sizes are generated larger. min_generation_area defaults to 4194304 pixels (2048x2048). A smaller size is generated on a larger canvas at the same aspect ratio and resized back with LANCZOS. Pass 1024 to turn this off.
  • Prompt style matters. Short prompts are not what the model expects. Write a detailed English description, or use the PE model or MiniMax’s API for expansion.
  • License. This is not a standard open-source license. The card says separate written authorization under Section IV of the license is requested through MiniMax’s application form. Read the license before commercial use.

When to pick it

Pick it if you want very high-resolution images or multi-reference editing from open weights, and you have the GPU to serve a 33.1B-parameter transformer plus a large text encoder. The card claims “the strongest instruction following among open-source models”, but it gives no benchmark numbers for that, so test it on your own prompts.

Skip it if you need a small download, a permissive license, or a model that works well with short prompts out of the box. The card gives no minimum VRAM figure, so budget time to measure memory use on your hardware.

Related