Text Generation
Transformers
Safetensors
MiniMax H3
English
qwen3_5
image-text-to-text
prompt-expansion
text-to-image
fp4
sglang
conversational
8-bit precision
modelopt
Instructions to use MiniMaxAI/MiniMax-H3-Image-PE with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MiniMaxAI/MiniMax-H3-Image-PE with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MiniMaxAI/MiniMax-H3-Image-PE") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("MiniMaxAI/MiniMax-H3-Image-PE") model = AutoModelForMultimodalLM.from_pretrained("MiniMaxAI/MiniMax-H3-Image-PE", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use MiniMaxAI/MiniMax-H3-Image-PE with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MiniMaxAI/MiniMax-H3-Image-PE" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MiniMaxAI/MiniMax-H3-Image-PE", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/MiniMaxAI/MiniMax-H3-Image-PE
- SGLang
How to use MiniMaxAI/MiniMax-H3-Image-PE with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "MiniMaxAI/MiniMax-H3-Image-PE" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MiniMaxAI/MiniMax-H3-Image-PE", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "MiniMaxAI/MiniMax-H3-Image-PE" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MiniMaxAI/MiniMax-H3-Image-PE", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use MiniMaxAI/MiniMax-H3-Image-PE with Docker Model Runner:
docker model run hf.co/MiniMaxAI/MiniMax-H3-Image-PE
Preserve latest main license information and model names
Browse files
README.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
| 1 |
---
|
| 2 |
pipeline_tag: text-generation
|
|
|
|
|
|
|
|
|
|
| 3 |
library_name: transformers
|
| 4 |
language:
|
| 5 |
- en
|
|
@@ -25,6 +28,7 @@ tags:
|
|
| 25 |
<a href="https://modelscope.cn/organization/minimax" target="_blank" rel="noopener noreferrer"><img alt="ModelScope MiniMax AI" src="https://img.shields.io/badge/ModelScope-MiniMax%20AI-white?labelColor=%23EF3D5D"></a>
|
| 26 |
<a href="https://platform.minimaxi.com/docs/faq/contact-us" target="_blank"><img src="https://img.shields.io/badge/WeChat-07C160?logo=wechat&logoColor=white" alt="WeChat"></a>
|
| 27 |
<a href="https://discord.com/invite/dbMxutw7tP" target="_blank"><img src="https://img.shields.io/badge/Discord-5865F2?logo=discord&logoColor=white" alt="Discord"></a>
|
|
|
|
| 28 |
</p>
|
| 29 |
|
| 30 |
# MiniMax-H3-Image-PE
|
|
@@ -51,7 +55,7 @@ This repository covers two workflows:
|
|
| 51 |
|
| 52 |
| Workflow | Input | Released assets |
|
| 53 |
| --- | --- | --- |
|
| 54 |
-
| **Text-to-image (T2I) PE** | A text instruction |
|
| 55 |
| **Image editing PE** | An editing instruction and reference images | A task prompt and message-assembly example for a vision-language model of your choice |
|
| 56 |
|
| 57 |
T2I PE expands the scene, composition and visual details of a generation request.
|
|
@@ -59,21 +63,21 @@ Image editing PE describes the intended changes while preserving relevant conten
|
|
| 59 |
reference images. **Image editing PE is still under development; this release provides its
|
| 60 |
prompt only.**
|
| 61 |
|
| 62 |
-
The examples below explain how to use
|
| 63 |
|
| 64 |
## How to use T2I PE
|
| 65 |
|
| 66 |
Run the examples from a local copy of this repository so the relative prompt and
|
| 67 |
script paths resolve correctly.
|
| 68 |
|
| 69 |
-
### Serve
|
| 70 |
|
| 71 |
We recommend SGLang with `sglang>=0.5.23` and `xgrammar>=0.2.7`.
|
| 72 |
|
| 73 |
```bash
|
| 74 |
sglang serve \
|
| 75 |
--model-path MiniMaxAI/MiniMax-H3-Image-PE \
|
| 76 |
-
--served-model-name
|
| 77 |
--model-type llm \
|
| 78 |
--reasoning-parser qwen3 \
|
| 79 |
--grammar-backend xgrammar \
|
|
@@ -108,7 +112,7 @@ system_prompt = Path("prompt/t2i/system_prompt.txt").read_text(encoding="utf-8")
|
|
| 108 |
params = json.loads(Path("prompt/t2i/request_params.json").read_text(encoding="utf-8"))
|
| 109 |
payload = {
|
| 110 |
**params,
|
| 111 |
-
"model": "
|
| 112 |
"messages": [
|
| 113 |
{"role": "system", "content": system_prompt},
|
| 114 |
{"role": "user", "content": user_prompt},
|
|
@@ -131,7 +135,7 @@ The included client performs the same request and checks the response:
|
|
| 131 |
```bash
|
| 132 |
python3 scripts/expand_prompt.py \
|
| 133 |
--url http://0.0.0.0:30000 \
|
| 134 |
-
--model
|
| 135 |
"An orange tabby cat sleeping on a sunlit windowsill."
|
| 136 |
```
|
| 137 |
|
|
@@ -250,3 +254,9 @@ and describes new content. Descriptive prose is English; literal text retains th
|
|
| 250 |
language you request. `target_aspect_ratio` is a positive-integer `W:H` string.
|
| 251 |
If you select an explicit ratio, the model preserves it exactly. If you select
|
| 252 |
`adaptive`, the model determines a numeric ratio for the intended edited image.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
pipeline_tag: text-generation
|
| 3 |
+
license: other
|
| 4 |
+
license_name: minimax-h3-image-community-license-agreement
|
| 5 |
+
license_link: https://huggingface.co/MiniMaxAI/MiniMax-H3-Image/blob/main/LICENSE
|
| 6 |
library_name: transformers
|
| 7 |
language:
|
| 8 |
- en
|
|
|
|
| 28 |
<a href="https://modelscope.cn/organization/minimax" target="_blank" rel="noopener noreferrer"><img alt="ModelScope MiniMax AI" src="https://img.shields.io/badge/ModelScope-MiniMax%20AI-white?labelColor=%23EF3D5D"></a>
|
| 29 |
<a href="https://platform.minimaxi.com/docs/faq/contact-us" target="_blank"><img src="https://img.shields.io/badge/WeChat-07C160?logo=wechat&logoColor=white" alt="WeChat"></a>
|
| 30 |
<a href="https://discord.com/invite/dbMxutw7tP" target="_blank"><img src="https://img.shields.io/badge/Discord-5865F2?logo=discord&logoColor=white" alt="Discord"></a>
|
| 31 |
+
<a href="https://huggingface.co/MiniMaxAI/MiniMax-H3-Image/blob/main/LICENSE"><img src="https://img.shields.io/badge/LICENSE-4CAF50?logo=creativecommons&logoColor=white" alt="LICENSE"></a>
|
| 32 |
</p>
|
| 33 |
|
| 34 |
# MiniMax-H3-Image-PE
|
|
|
|
| 55 |
|
| 56 |
| Workflow | Input | Released assets |
|
| 57 |
| --- | --- | --- |
|
| 58 |
+
| **Text-to-image (T2I) PE** | A text instruction | MiniMax-H3-Image-PE weights (fine-tuned from Qwen3.8-27B, FP4), task and system prompts, and a client example |
|
| 59 |
| **Image editing PE** | An editing instruction and reference images | A task prompt and message-assembly example for a vision-language model of your choice |
|
| 60 |
|
| 61 |
T2I PE expands the scene, composition and visual details of a generation request.
|
|
|
|
| 63 |
reference images. **Image editing PE is still under development; this release provides its
|
| 64 |
prompt only.**
|
| 65 |
|
| 66 |
+
The examples below explain how to use MiniMax-H3-Image-PE and the image editing task prompt.
|
| 67 |
|
| 68 |
## How to use T2I PE
|
| 69 |
|
| 70 |
Run the examples from a local copy of this repository so the relative prompt and
|
| 71 |
script paths resolve correctly.
|
| 72 |
|
| 73 |
+
### Serve MiniMax-H3-Image-PE
|
| 74 |
|
| 75 |
We recommend SGLang with `sglang>=0.5.23` and `xgrammar>=0.2.7`.
|
| 76 |
|
| 77 |
```bash
|
| 78 |
sglang serve \
|
| 79 |
--model-path MiniMaxAI/MiniMax-H3-Image-PE \
|
| 80 |
+
--served-model-name MiniMax-H3-Image-PE \
|
| 81 |
--model-type llm \
|
| 82 |
--reasoning-parser qwen3 \
|
| 83 |
--grammar-backend xgrammar \
|
|
|
|
| 112 |
params = json.loads(Path("prompt/t2i/request_params.json").read_text(encoding="utf-8"))
|
| 113 |
payload = {
|
| 114 |
**params,
|
| 115 |
+
"model": "MiniMax-H3-Image-PE",
|
| 116 |
"messages": [
|
| 117 |
{"role": "system", "content": system_prompt},
|
| 118 |
{"role": "user", "content": user_prompt},
|
|
|
|
| 135 |
```bash
|
| 136 |
python3 scripts/expand_prompt.py \
|
| 137 |
--url http://0.0.0.0:30000 \
|
| 138 |
+
--model MiniMax-H3-Image-PE \
|
| 139 |
"An orange tabby cat sleeping on a sunlit windowsill."
|
| 140 |
```
|
| 141 |
|
|
|
|
| 254 |
language you request. `target_aspect_ratio` is a positive-integer `W:H` string.
|
| 255 |
If you select an explicit ratio, the model preserves it exactly. If you select
|
| 256 |
`adaptive`, the model determines a numeric ratio for the intended edited image.
|
| 257 |
+
|
| 258 |
+
## License
|
| 259 |
+
|
| 260 |
+
- MiniMax-H3-Image-PE is part of MiniMax-H3-Image and is released under the [MiniMax-H3-Image Community License Agreement](https://huggingface.co/MiniMaxAI/MiniMax-H3-Image/blob/main/LICENSE).
|
| 261 |
+
- MiniMax-H3-Image-PE is derived from [Qwen3.8-27B](https://huggingface.co/Qwen/Qwen3.8-27B), which is licensed under the Apache 2.0 License.
|
| 262 |
+
- The separate written authorization described in Section IV of the license is requested through [platform.minimax.io/license](https://platform.minimax.io/license).
|