Felo API PlatformFelo API Platform
返回模型列表

MiniMax H3 Image API

MiniMax-H3-Image 是 MiniMax 推出的图像生成与编辑模型,支持文生图和多参考图编辑,最高输出 4096×4096 像素。

MiniMax-H3-Image 是 MiniMax 旗下的图像生成与编辑模型,接受文本与图像输入并输出图像。它支持文生图,也支持最多 16 张参考图的图像编辑,可输出 4096×4096 像素(1600 万像素)的高分辨率画面,兼顾丰富细节与逼真质感。文档称其在开源模型中指令遵循能力最强。

模型采用固定推理设置:num_inference_steps 为 6、guidance_scale 为 1,提示词会被截断至 4096 tokens。它不支持负面提示词,传入会被拒绝;改动推理参数会返回 HTTP 400 错误。min_generation_area 可设 1024 至 16777216 像素,默认 4194304(2048×2048);请求较小尺寸时,模型会按相同宽高比在更大画布上生成,再用 LANCZOS 插值缩放。为便于复现随机种子,建议将 generator device 设为 CPU,response_format 设为 b64_json。

它适合广告与品牌、电商、产品设计、UI/UX、游戏、概念艺术、产品探索与版式迭代等场景,也适合只改动局部、同时保持画面其余部分一致的精细编辑。H3-Image-Context-IR 可将其他语言的简短提示词扩写为详细的英文描述。模型依据 MiniMax-H3-Image Community License Agreement 发布,如需另行书面授权的商业用途,可通过 platform.minimax.io/license 申请。

更新时间:

模型 ID

minimax-h3-image
输入
text / image
输出
image

核心要点

  • 最高 4096×4096 像素输出
  • 最多 16 张参考图编辑
  • 开源模型中指令遵循最强
  • 固定 6 步推理,guidance 1
  • 提示词截断至 4096 tokens
  • 不支持负面提示词

供应商

1 个供应商

比较不同供应商的调用价格,点击供应商可查看完整费用和适用条件。

供应商 · 计费明细
可用率

快速开始

提交图片任务、轮询状态,再保存图片。以下示例使用 curl 和 Python 3(仅标准库,无需安装依赖)。

POST https://openapi.felo.ai/api/v1/images/generations

1填入 API key

从 Felo API Platform 账户创建 key,并设置为环境变量。

export FELO_API_KEY="YOUR_API_KEY"

2发起第一次请求

可选参数的取值因模型而异,示例不预设这些值;添加前请在 Playground 确认。请求字段与 model、prompt 同级,不包在 input 中。

curl --fail-with-body --max-time 60 "https://openapi.felo.ai/api/v1/images/generations" \
  -H "Authorization: Bearer $FELO_API_KEY" \
  -H "Content-Type: application/json" \
  -o created.json \
  -d '{
  "prompt": "A studio product photo of a ceramic coffee cup on warm linen, soft morning light",
  "model": "minimax-h3-image"
}'

3轮询任务

提交后获得 task_id;queued、running 时每 3 秒查询一次,succeeded、failed 或 interrupted 时停止。示例最多等待 30 分钟。保留 created.json 可继续查询同一任务,避免重复提交。

python3 - <<'PY'
import json, os, time
from pathlib import Path
from urllib.parse import quote
from urllib.request import Request, urlopen

task = json.loads(Path("created.json").read_text())
task_id = task["task_id"]
url = "https://openapi.felo.ai/api/v1/images/generations/" + quote(task_id, safe="")
headers = {"Authorization": "Bearer " + os.environ["FELO_API_KEY"]}
deadline = time.monotonic() + 1800

while task["status"] in ("queued", "running"):
    if time.monotonic() >= deadline:
        raise TimeoutError(f"Keep task_id={task_id} to resume polling")
    time.sleep(3)
    with urlopen(Request(url, headers=headers), timeout=60) as response:
        task = json.load(response)
    if task.get("task_id") != task_id or task.get("kind") != "image":
        raise ValueError("Unexpected task response")
    print(task["status"])

if task["status"] != "succeeded":
    raise RuntimeError(task.get("error") or task["status"])
if not task.get("outputs"):
    raise ValueError("Task succeeded without image outputs")
Path("task.json").write_text(json.dumps(task))
print("Saved task.json")
PY

4下载输出

成功后从 task.json 读取 outputs 并保存。结果兼容 HTTPS 地址、URL 对象和 b64_json。签名地址请及时下载;下载图片时无需携带 API Key。

python3 - <<'PY'
import base64, json
from pathlib import Path
from urllib.request import urlopen

task = json.loads(Path("task.json").read_text())
if task.get("status") != "succeeded" or not task.get("outputs"):
    raise ValueError("No completed image outputs")
extensions = {"image/png": ".png", "image/jpeg": ".jpg", "image/webp": ".webp", "image/gif": ".gif", "image/avif": ".avif"}

for index, output in enumerate(task["outputs"], 1):
    item = output if isinstance(output, dict) else {}
    url = output if isinstance(output, str) else item.get("url") or item.get("unsigned_url")
    mime = item.get("media_type") or "image/png"
    if url and url.startswith("https://"):
        with urlopen(url, timeout=60) as response:
            data = response.read()
            mime = response.headers.get_content_type()
    elif url and url.startswith("data:image/") and ";base64," in url:
        header, encoded = url.split(",", 1)
        mime = header[5:].split(";", 1)[0]
        data = base64.b64decode(encoded, validate=True)
    elif item.get("b64_json"):
        data = base64.b64decode(item["b64_json"], validate=True)
    else:
        raise ValueError("Unrecognized image output")
    path = Path(f"image-{index}" + extensions.get(mime, ".bin"))
    path.write_bytes(data)
    print(path)
PY
input_references

编辑图片时,将示例地址替换为你的 HTTPS 图片地址或 base64 图片 data URL。提交一次后,沿用相同的轮询与保存步骤。

curl --fail-with-body --max-time 60 "https://openapi.felo.ai/api/v1/images/generations" \
  -H "Authorization: Bearer $FELO_API_KEY" \
  -H "Content-Type: application/json" \
  -o created.json \
  -d '{
  "prompt": "Keep the product and framing. Replace the background with a sunlit marble countertop.",
  "model": "minimax-h3-image",
  "input_references": [
    {
      "type": "image_url",
      "image_url": {
        "url": "https://example.com/product.png"
      }
    }
  ]
}'

支持的参数

  • n
  • size
  • resolution
  • aspect_ratio
  • output_format
  • input_references

想查看完整文档?

API 文档 →

常见问题

什么是 MiniMax H3 Image?

MiniMax-H3-Image 是 MiniMax 旗下的图像生成与编辑模型,接受文本与图像输入并输出图像。它支持文生图,也支持最多 16 张参考图的图像编辑,可输出 4096×4096 像素(1600 万像素)的高分辨率画面,兼顾丰富细节与逼真质感。文档称其在开源模型中指令遵循能力最强。 模型采用固定推理设置:num_inference_steps 为 6、guidance_scale 为 1,提示词会被截断至 4096 tokens。它不支持负面提示词,传入会被拒绝;改动推理参数会返回 HTTP 400 错误。min_generation_area 可设 1024 至 16777216 像素,默认 4194304(2048×2048);请求较小尺寸时,模型会按相同宽高比在更大画布上生成,再用 LANCZOS 插值缩放。为便于复现随机种子,建议将 generator device 设为 CPU,response_format 设为 b64_json。 它适合广告与品牌、电商、产品设计、UI/UX、游戏、概念艺术、产品探索与版式迭代等场景,也适合只改动局部、同时保持画面其余部分一致的精细编辑。H3-Image-Context-IR 可将其他语言的简短提示词扩写为详细的英文描述。模型依据 MiniMax-H3-Image Community License Agreement 发布,如需另行书面授权的商业用途,可通过 platform.minimax.io/license 申请。

如何计算调用费用?

费用取决于你使用的供应商、对应价格和实际用量。长文本输入等情况可能适用不同价格,详见计费明细。 按实际生成费用计费,具体金额以账单为准。

MiniMax-H3-Image 支持哪些输入和输出?

支持文本输入与图像输入,输出为图像。可用于文生图,也可做多参考图编辑,最多支持 16 张参考图。

输出分辨率能到多少?

可生成 4096×4096 像素(1600 万像素)的图像。min_generation_area 取值范围为 1024 至 16777216 像素,默认 4194304(2048×2048)。

提示词长度有什么限制?

提示词会被截断至 4096 tokens。

可以调整采样步数或 guidance scale 吗?

不可以。模型固定使用 num_inference_steps 6 与 guidance_scale 1,传入其他数值会返回 HTTP 400 错误。

支持负面提示词吗?

不支持,负面提示词会被拒绝。

它和 MiniMax-H3-Image-PE 有什么区别?

MiniMax-H3-Image-PE 是可在本地部署的变体,能配合本地 SGLang 服务器运行。

相关模型