跳到正文
MiniMax 模型发布·· 3 小时前精选AI 评分80

MiniMax 开源 MiniMax-H3-Image 图像生成与编辑模型

MiniMaxAI/MiniMax-H3-Image

AI 导读

MiniMax 开源 MiniMax-H3-Image,将文生图与图像编辑统一在同一个 checkpoint 中,支持最多 16 张参考图。模型采用 33.1B 参数的 DiT,蒸馏至 6 步采样且无需 classifier-free guidance,可在 4096x4096 至 6272x2688 等比例下直接生成约 16MP 图像。

推荐理由

开源图像模型把文生图与编辑统一在一个 checkpoint,并给出 16MP 输出与本地部署方案,便于开发者评估落地成本。

正文 · AI 翻译

MiniMax H3 image, Open Weights

在线 API

通过 API 直接使用 MiniMax-H3-Image。

API 文档:

在线应用

通过 App 直接使用 MiniMax-H3-Image。

简介

MiniMax-H3-Image 是 MiniMax H3 系列中用于图像生成与编辑的最先进开源模型。它将 对创作意图的智能理解与构建视觉世界的能力相结合:凭借精准的 指令遵循能力,它能把创意概念发展为具体的角色、场景和 氛围。生成与编辑统一在同一个 checkpoint 中,既能从 文本生成图像(文生图),也能编辑一张或多张参考图像(图像编辑),为创作者 和开发者提供灵活可控的图像创作方式。

它在每种宽高比下都能生成约 1600 万像素的图像,从 4096x4096(1:1)到 6272x2688(21:9),直接生成且无需放大器(参见 尺寸)。该 checkpoint 经过 蒸馏,仅需 6 个采样步(6 NFE),且无需无分类器引导。其扩散 Transformer(DiT)采用 H3 架构但去掉了音频层,并使用 未经改动的 MiniMax-H3 文本编码器。

Fifteen MiniMax-H3-Image text-to-image results in landscape and portrait formats: a 3D fantasy battle, a blue-green landscape painting, a tree frog, an indigo-dyed rabbit, a 3D white-haired girl, a portrait among flowers, a sci-fi city, dumplings, a highland cow, a mirror portrait, a 3D otter and sheep, a pixel art cat, a jewel beetle, giant cherries and a fisheye selfie

亮点

MiniMax-H3-Image 汇聚三大核心优势:速度、图像质量和指令 遵循能力。

  1. 以实用的计算成本生成 1600 万像素图像。 与当今常见的 100–400 万像素输出 相比,1600 万像素(4096 × 4096)图像能提供远为丰富的细节,但通常需要 显著更多的计算量。MiniMax-H3-Image 将这一计算成本控制在可接受范围内, 使 1600 万像素生成在日常创作中切实可行。
  2. 细节丰富。逼真出众。 MiniMax-H3-Image 超越了人们熟悉的“AI 感”, 生成细节繁复、逼真写实的图像,为 创意和专业用途开辟了更多可能。它让生成的图像更接近真实视觉世界的 丰富与细腻。
  3. 更强的指令遵循能力。 更强的创作控制力。出色的图像生成 不止于漂亮的画面——它帮助创作者将想法变为现实。MiniMax-H3-Image 在开源模型中提供最强的指令遵循能力,并支持多达 16 张参考图像,让创作者对最终结果拥有更多控制权。

模型库

模型 角色 精度 大小 HF 镜像
MiniMax-H3-Image 文生图与图像编辑 BF16 (DiT) 68.65 GB MiniMaxAI/MiniMax-H3-Image
MiniMax-H3-Image-PE(可选) 用于文生图的提示词扩展器 NVFP4 17.9 GB MiniMaxAI/MiniMax-H3-Image-PE

模型架构

MiniMax-H3-Image 沿用 H3-Base 设计,但移除了音频分支。文本 提示词和参考图像由 H3 文本编码器编码;参考图像 还由图像 VAE 编码。所有 token 组成一个打包序列,输入单流 Transformer,由其预测目标图像的 latent。VAE 将该 latent 解码为图像。

  • 文本编码器:MiniMax-H3 的完整 Qwen3-VL 文本编码器,未作改动。DiT 读取其第 50 层的隐藏状态。
  • 图像 VAE:一个 CNN 编码器和一个 2D ViT 解码器(24 层),具有 16 倍空间下采样和 24 个潜在通道。DiT 以 2x2 的 patch 对潜在表示进行 patchify,因此每个 transformer token 覆盖 32x32 像素。
  • 扩散 transformer:33.1B 参数,一个密集的单流 transformer,具有 50 层(隐藏大小 5376,56 个注意力头,FFN 大小 14336)和 3D 多模态 RoPE,与 H3-Omni-Transformer 相同。权重为 BF16;嵌入层、时间步层和输出层为 FP32。

快速开始

下载

组件 内容 大小
transformer/ DiT:BF16,其中嵌入层、时间步层和输出层为 FP32。 66.28 GB
pdd_fused_heads.safetensors, pdd_config.json 替代 transformer 输出层的每步输出头,以及采样调度。 12 MB
vae/ 图像 VAE,FP32。 2.34 GB
tokenizer/, processor/ Qwen3-VL 分词器和处理器,与 MiniMax-H3 相同。 23 MB
文本编码器 不在本仓库中。model_index.json 从 MiniMaxAI/MiniMax-H3 的文件夹 text_encoder/ 加载它。如果你已有 MiniMax-H3,则不会再次下载。 66.7 GB
MiniMax-H3-Image/
├── model_index.json
├── pdd_config.json
├── pdd_fused_heads.safetensors
├── processor/
├── tokenizer/
├── transformer/
└── vae/

将此仓库和 MiniMax-H3 文本编码器下载到 HF Mirror 缓存:

hf download MiniMaxAI/MiniMax-H3-Image
hf download MiniMaxAI/MiniMax-H3 --include "text_encoder/*"
# optional prompt expander
hf download MiniMaxAI/MiniMax-H3-Image-PE

本地部署

我们推荐使用以下推理框架来服务该模型:

vLLM-Omni 部署

有关各硬件的部署配置和实测延迟,请参见 vLLM-Omni recipe。支持 NVIDIA 和 AMD 加速器,包括 NVIDIA H200、RTX PRO 6000 Blackwell、AMD Instinct MI350X 等。

在单个 GPU 上启动服务器:

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

为降低延迟,可使用序列并行(Ulysses)将每个请求拆分到多个 GPU 上,例如在 4 个 GPU 上:

vllm serve MiniMaxAI/MiniMax-H3-Image --omni --host 0.0.0.0 --port 8000 \
  --num-gpus 4 --usp 4 --text-encoder-tp-size 4

SGLang 部署

这里我们以 SGLang 作为部署示例。有关其他部署配置,请参见 MiniMax-H3-Image 部署指南。

在单个 GPU 上启动服务器:

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

要使用 MiniMax-H3 text_encoder/ 文件夹的本地副本而不是 HF Mirror 缓存,请添加 --text-encoder-path <path to text_encoder>。

为降低延迟,可使用序列并行(Ulysses)将每个请求拆分到多个 GPU 上,例如在 4 个 GPU 上:

sglang serve --model-path MiniMaxAI/MiniMax-H3-Image --host 0.0.0.0 --port 30000 --warmup-mode off \
  --num-gpus 4 --ulysses-degree 4

请求参数

文生图请求是以 JSON 形式发送到 /v1/images/generations。图像编辑请求将参考图像作为 multipart 表单数据发送到 /v1/images/edits;它们的顺序决定了提示词中的 <Picture 1>、<Picture 2> 等。两者都在 data[0].b64_json 中返回 PNG。可运行的示例见 完整工作流。

字段 文生图 图像编辑 说明
prompt 必填 必填 按给定内容使用,截断至 4096 个 token。参见 完整工作流
size 必填 必填 WIDTHxHEIGHT。返回的图像正好是这个尺寸;参见 尺寸
image — 一个或多个文件 按上传顺序,它们在提示词中依次为 <Picture 1>、<Picture 2>、……
seed 推荐 推荐 整数
generator_device 推荐 cpu 推荐 cpu 相同的种子,在每台机器上产生相同的初始噪声
response_format b64_json b64_json
min_generation_area 可选 可选 生成的最小面积(像素),1024-16777216,默认 4194304(2048x2048)。较小的 size 会以相同宽高比在更大的画布上生成,然后用 LANCZOS 缩放回来;传入 1024 可关闭此功能。下表中的所有尺寸都高于默认值
num_inference_steps 省略或 6 省略或 6 其他值返回 HTTP 400
guidance_scale 省略或 1 省略或 1 其他值返回 HTTP 400
negative_prompt 不支持 不支持 已拒绝

尺寸

MiniMax-H3-Image 的有效工作范围约为 4 MP 至 20 MP,通常在 16 MP 左右效果最佳。常见的 16 MP 尺寸如下所示:

宽高比 尺寸(宽 x 高)
1:1 4096x4096
4:3 / 3:4 4736x3552 / 3552x4736
3:2 / 2:3 5024x3360 / 3360x5024
16:9 / 9:16 5472x3072 / 3072x5472
21:9 6272x2688

完整工作流

MiniMax-H3-Image 期望获得对整幅图像的详细英文描述。MiniMax API 会在生成前使用 H3-Image-Context-IR 将任意语言的简短提示词转换为这样的描述。我们还提供 MiniMax-H3-Image-PE,它可 在本地部署。

本节复现了使用本地部署的 SGLang 服务器时,由 MiniMax API 直接生成图像的质量。脚本位于 examples/,仅使用 Python 标准库;请在该文件夹中运行它们:

hf download MiniMaxAI/MiniMax-H3-Image --include "examples/*" --local-dir .
cd examples

在运行示例之前,请设置你的 MiniMax API 端点和密钥,以便使用 H3-Image-Context-IR API 和参考脚本。脚本会从环境变量中读取它们:

# MiniMax API endpoint (choose one)
# CN
export MINIMAX_API_BASE="https://api.minimax.cn"
# Global
# export MINIMAX_API_BASE="https://api.minimax.io"

# API key obtained from the MiniMax platform
export MINIMAX_API_KEY="<api-key>"

API 文档:

case-T2I

instruction.t2i.txt。

阶段请求结果
提示词增强H3-Image-Context-IR(MiniMax API)python3 context_ir.py t2i(脚本)revised_prompt.txt、revised_size.txt;我们的运行结果:revised_prompt.t2i.txt、revised_size.t2i.txt(4736x3552)
本地替代方案:MiniMax-H3-Image-PEPE 仓库中的 scripts/expand_prompt.py将 expanded_caption 保存为 revised_prompt.txt,并将 aspect_ratio 的尺寸保存为 revised_size.txt
MiniMax-H3-Image 生成:本地 SGLangpython3 t2i.py --prompt revised_prompt.txt --size $(cat revised_size.txt)(脚本)t2i.png
端到端 API 参考:通过直接调用 MiniMax API 进行文生图python3 api_generate.py t2i(脚本)api_t2i.png

Left: t2i.png from local SGLang with the enhanced prompt. Right: api_t2i.png from the MiniMax API. Both show an overhead farm-to-table feast with bread, vegetables and cheeses on a weathered wooden table

来自本地 SGLang 的 t2i.png(左)和来自 MiniMax API 的 api_t2i.png(右),4736x3552(由 H3-Image-Context-IR 选择 4:3)

case-Edit

instruction.edit.txt 使用参考图像 reference1.png 作为 <Picture 1>。

阶段 请求 结果
提示词增强:H3-Image-Context-IR(MiniMax API) python3 context_ir.py edit(脚本) revised_prompt.txt、revised_size.txt;我们的运行结果:revised_prompt.edit.txt、revised_size.edit.txt(4096x4096)
MiniMax-H3-Image 生成:本地 SGLang python3 edit.py --prompt revised_prompt.txt --size $(cat revised_size.txt)(脚本) edit.png
端到端 API 参考:通过直接调用 MiniMax API 进行图像编辑 python3 api_generate.py edit(脚本) api_edit.png

Left: reference1.png, the reference image of two podcast hosts with the man wearing headphones. Middle: edit.png from local SGLang with the enhanced prompt. Right: api_edit.png from the MiniMax API. In both results the headphones are gone and the hosts bump fists above the MONEY TALKS sign

参考图像 reference1.png(左)、来自本地 SGLang 的 edit.png(中)和来自 MiniMax API 的 api_edit.png(右),4096x4096(由 H3-Image-Context-IR 选择 1:1)

展示

文生图和图像编辑结果,以缩小尺寸展示。

Three photorealistic photographs: a woman hanging white sheets on a rooftop at dusk under a full moon, a close-up profile of a curly-haired young man holding a cup, and flamingos wading in shallow water

写实摄影

Three surreal editorial photographs: a barber trimming a cloud seated in a barber chair, a person slicing the moon on a lawn at night, and a model stepping out of a giant pear

超现实编辑摄影

Four environment concepts: ruins of an ancient open-air theater in a forest titled ENVIRONMENT CONCEPT: THE ANCIENT THEATER, a dragon rider on a red rock cliff, an abandoned railway station with an ARRIVALS sign, and shipwrecks frozen in an icy sea

环境概念

Characters, creatures and props: a soldier in a worn helmet and armor, a red-finned dragon-like creature in a forest, a weathered astronaut helmet on Mars, and a three-view character sheet of a figure in winter clothing

角色、生物和道具

Four paintings and illustrations: mandarin ducks in a lotus pond in an oil painting style, a Jiangnan garden in light watercolor, tarot card XVIII THE MOON with a rabbit, and a Chinese gongbi painting of a pelican looking into a mirror with four calligraphy characters

绘画与插画风格

Two logic puzzle boards: a Chinese candidate-selection puzzle with five conditions and the derived answer, and an English board titled CONFIDENTIAL FILE MISSING with six suspects, true/false stamps and a verification table

带推理的文本渲染:中英文逻辑谜题,在棋盘上正确解答

Left: untextured grey 3D render of a lunar base with habitat modules, a rover and an astronaut. Right: the same scene as a photorealistic film still on the lunar surface

图像编辑,单参考图:将无纹理的 3D 渲染图(左)变为月球研究基地的电影剧照(右)

Left: illustrated game map with a river, a waterfall, bridges, a castle, a village, a mine and a harbor, and a red arrow on the southern lake. Right: first-person 3D game view from the lake towards the waterfall, the suspension bridge, the mine and the distant castle, with the map as a minimap in the top-left corner

图像编辑,单参考图:将游戏地图(左)变为从红色箭头位置出发的第一人称 3D 游戏视角,并将地图作为小地图(右)

Top: ten reference images, an empty sunlit room and nine pieces of furniture. Bottom: the empty room furnished with all nine pieces as a living room

图像编辑,十张参考图:将空房间和九件家具(上)合成为一个客厅(下)

许可证

联系我们

请通过 model@minimax.io 联系我们。

来源:MiniMax 模型发布 · hf-mirror.com