How Do I Use Reference Images with the MiniMax H3 API?
How to pass reference images to the MiniMax H3 API for character, style, and product consistency across shots.

Overview
Reference images are how you hold a character, style, or product steady across shots. In the MiniMax H3 API you attach them through the content array alongside your text prompt, so confirm the accepted count, format, and how each image is tagged in the current schema before building a multi-shot workflow around it.
That content array belongs to MiniMax’s direct v2 API. WaveSpeed’s H3 reference-to-video endpoint instead takes a prompt and a reference_images array of image URLs. Check which route you are calling before copying a request body.

If reference inputs are part of your production workflow, also account for any reference image charges in MiniMax H3 pricing when estimating the cost of each generation.
Source note: Verified 2026-08-06 against the MiniMax official H3 blog, MiniMax Video Generation API docs, and Hugging Face MiniMax-H3 model page.
Use the slots with intent rather than volume. Pick references that agree on identity, lighting, and framing, because conflicting images pull the result in different directions. Where you can label roles — this image is the character, this one the product, this one the scene — do so explicitly, since a clear role helps the model apply each reference to the right part of the output. A few clean, purposeful references usually beat the maximum number of noisy ones.
Keep the images at a supported resolution and free of clutter you do not want carried into the video, then let your prompt handle the action and camera while the references hold the look.
The request itself runs asynchronously like any other: submit with the references attached, store the task ID, poll for completion, and save the output. Test with one reference first so you can see how strongly it steers the result before adding more.
For MiniMax’s direct v2 endpoint, the current API reference permits up to nine reference images. Each image must be at most 30 MB, measure 256–5760 pixels on each side, and have a width-to-height ratio of 0.4–2.5. It lists JPG, JPEG, PNG, WebP, HEIC, and HEIF. A reference image uses role: "reference_image"; a first or last frame is a different input mode and cannot be mixed with reference roles in the same request. These file limits are documented for MiniMax’s direct route—check the selected WaveSpeed endpoint separately.

Here is a one-image example for that direct MiniMax route, from local image checks through download. reference.png and REFERENCE_IMAGE_URL must refer to the same image; host it at an accessible URL before running the script. Install requests and Pillow, then set MINIMAX_API_KEY and REFERENCE_IMAGE_URL. The sample validator accepts JPEG, PNG, and WebP. This code passed a syntax check on 2026-11-20; no paid generation was run for this article.
import os
import time
from pathlib import Path
import requests
from PIL import Image
api_key = os.environ["MINIMAX_API_KEY"]
assets = [(Path("reference.png"), os.environ["REFERENCE_IMAGE_URL"])]
if not 1 <= len(assets) <= 9:
raise ValueError("Use 1–9 reference images.")
for path, url in assets:
if not url.startswith(("https://", "http://")):
raise ValueError(f"An accessible image URL is required: {url}")
if path.stat().st_size > 30 * 1024 * 1024:
raise ValueError(f"Image exceeds 30 MB: {path}")
with Image.open(path) as image:
width, height = image.size
if image.format not in {"JPEG", "PNG", "WEBP"}:
raise ValueError(f"Unsupported sample format: {image.format}")
if not (256 <= width <= 5760 and 256 <= height <= 5760):
raise ValueError(f"Image dimensions out of range: {path}")
if not 0.4 <= width / height <= 2.5:
raise ValueError(f"Image aspect ratio out of range: {path}")
image.verify()
content = [{
"type": "text",
"text": (
"Use reference image 1 for the product's appearance. "
"Keep its shape and color; slowly pan right across a clean tabletop."
),
}]
content += [
{"type": "image_url", "image_url": {"url": url}, "role": "reference_image"}
for _, url in assets
]
payload = {
"model": "MiniMax-H3",
"content": content,
"resolution": "768P",
"duration": 5,
"ratio": "16:9",
}
headers = {"Authorization": f"Bearer {api_key}"}
try:
response = requests.post(
"https://api.minimax.io/v2/video_generation",
headers=headers,
json=payload,
timeout=(10, 60),
)
except requests.RequestException as exc:
raise RuntimeError(
"Submit outcome unknown; check task history before submitting again."
) from exc
response.raise_for_status()
task_id = response.json()["task_id"]
print("Task ID:", task_id)
while True:
time.sleep(10)
response = requests.get(
f"https://api.minimax.io/v2/query/video_generation/{task_id}",
headers=headers,
timeout=(10, 30),
)
response.raise_for_status()
task = response.json()["task"]
if task["status"] == "succeeded":
video_url = task["content"]["url"]
break
if task["status"] in {"failed", "cancelled"}:
raise RuntimeError(
f"Task {task_id}: {task['status']} — {task.get('error')}"
)
with requests.get(video_url, stream=True, timeout=(10, 60)) as video:
video.raise_for_status()
with open("output.mp4", "wb") as output:
for chunk in video.iter_content(chunk_size=1024 * 1024):
if chunk:
output.write(chunk)
print("Saved output.mp4")
/filters:quality(82)/media/images/1773962750383987480_n3hqzHRZ.webp)
/filters:quality(82)/media/images/c50e7783-dfb8-44de-96cf-9cd9525359a2.webp)