MiniMax-H3-Image-PE

模型发布 Hugging Face 模型 · MiniMaxAI 原文语言:中文

官方机构模型仓库创建于 2026-11-08。仓库创建时间不等于正式发布日期。任务类型:text-generation

全文

MiniMax-H3-Image-PE

Online API

Use MiniMax-H3-Image directly via API.

Global: platform.minimax.io CN: platform.minimax.cn

API docs: Text-to-image: EN-docs, CN-docs Image editing: EN-docs, CN-docs Prompt expansion: EN-docs, CN-docs

Introduction

MiniMax-H3-Image-PE provides prompt expansion (PE) for MiniMax-H3-Image. It turns a short request into a detailed description of the intended image, together with an aspect-ratio recommendation for image generation.

This repository covers two workflows:

Workflow Input Released assets 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 Image editing PE An editing instruction and reference images A task prompt and message-assembly example for a vision-language model of your choice. Image editing PE is still under development; this release provides its prompt only.

The examples below explain how to use MiniMax-H3-Image-PE and the image editing task prompt.

How to use T2I PE

Run the examples from a local copy of this repository so the relative prompt and script paths resolve correctly.

Serve MiniMax-H3-Image-PE

We recommend SGLang with sglang>=0.5.23 and xgrammar>=0.2.7.

SGLang reads the FP4 configuration from the checkpoint. XGrammar constrains the answer to the JSON schema, and the reasoning parser separates reasoning from the final answer.

Expand a prompt

Load the task prompt and insert your instruction with .format(user_query):

Send it with the system prompt and request parameters:

The included client performs the same request and checks the response:

Request parameters

The examples load the defaults from prompt/t2i/request_params.json:

Parameter Value temperature / top_p / top_k 1.0 / 0.95 / 20 min_p 0.0 presence_penalty / repetition_penalty 0.0 / 1.0 max_tokens 4096, including thinking and the final answer reasoning_effort xhigh enable_thinking / preserve_thinking true / true response_format JSON schema for expanded_caption and aspect_ratio

Output

With --reasoning-parser qwen3, message.content contains the JSON answer. Reasoning is returned separately in message.reasoning_content. Example output:

When your aspect-ratio selection is auto, use the aspect_ratio returned by the model for image generation. If you select an explicit ratio, use your selected ratio instead of the model's recommendation at the image-generation stage.

How to use Image editing PE

Use the task prompt with a vision-language model that supports interleaved text and images. The example below describes message assembly without selecting a model or making an API call.

Inputs

Provide the following inputs:

Input Description user_query The editing instruction. Refer to images in their supplied order. references At least one prepared image, in order, with its original display aspect ratio as a reduced W:H string. Use None when the source ratio is unknown. aspect_ratio The target ratio: adaptive to let the model choose, or an explicit positive-integer W:H string.

Assemble the message

Load prompt/edit/task_prompt.txt unchanged as the first content part. Follow it with the image count, each image's label and source ratio immediately before that image, and your editing instruction and target ratio in the final text part. This produces one user message.

The fixed task prompt forms a shared prefix across requests, allowing reuse by services that support prefix caching. Cache behavior depends on the provider.

In the pseudocode below, source_image and reference_image are already prepared image inputs. The text and image parts are conceptual; adapt their representation to your model's interface.

Output

The description identifies source subjects, states what is preserved or changed, and describes new content. Descriptive prose is English; literal text retains the language you request. target_aspect_ratio is a positive-integer W:H string. If you select an explicit ratio, the model preserves it exactly. If you select adaptive, the model determines a numeric ratio for the intended edited image.

Use with Diffusers

MiniMax-H3-Image-PE can also run locally in Transformers through the diffusers/minimax-h3-image-pe-blocks Modular Diffusers blocks. The blocks use the released prompts and request parameters for T2I PE and Image editing PE, and XGrammar constrains the answer to the JSON schema.

Load MiniMax-H3-Image-PE

The FP4 weights stay in 4-bit and use about 19 GiB of GPU memory. GPUs with native FP4 support run the NVFP4 weights directly; other GPUs use bitsandbytes FP4.

Expand a prompt

Pass a request to run T2I PE:

Pass reference images to run Image editing PE. Refer to the images in their supplied order:

Inputs and outputs

Name Description prompt Input: the request or editing instruction. Output: the expanded caption. image One or more reference images (PIL images, paths or URLs). Selects Image editing PE. aspect_ratio Input, Image editing PE only: adaptive or an explicit W:H ratio. Output: the target ratio. enable_thinking Reasoning before the answer, True by default as in the released request. max_new_tokens Token budget, including thinking and the final answer. seed Seed for a reproducible expansion. reasoning Output: the model's reasoning.

Activations run in bf16, so outputs are not identical to the SGLang deployment above.

License

MiniMax-H3-Image-PE is part of MiniMax-H3-Image and is released under the MiniMax-H3-Image Community License Agreement. MiniMax-H3-Image-PE is derived from Qwen3.8-27B, which is licensed under the Apache 2.0 License. The separate written authorization described in Section IV of the license is requested through platform.minimax.io/license.

正文以来源语言显示。

参考来源

← 返回每日简报