MiniMax H3 Image Edit API
Edit and combine up to 16 reference images in 4K.
POST /v2/minimax-h3-image-edit · submit + poll 1# pip install "segmind>=1.1.0"
2# export SEGMIND_API_KEY="YOUR_API_KEY"
3import segmind
4
5# Async (v2): submit to the queue and block until COMPLETED.
6# run() returns the final result dict (600s deadline, 1.0s poll by default).
7result = segmind.run(
8 "minimax-h3-image-edit",
9 reference_images=["https://segmind-resources.s3.amazonaws.com/input/minimax-h3-image-edit-elephant-683ded41.jpg", "https://segmind-resources.s3.amazonaws.com/input/minimax-h3-image-edit-giraffe-1dac0d32.jpg"],
10 prompt="Picture 1 is a mustard hand-knitted plush elephant; Picture 2 is a wooden pull-along giraffe. Seat the knitted elephant from Picture 1 upright on the back of the wooden giraffe from Picture 2, on a pale birch nursery shelf with a window of diffused daylight to the left. Keep the elephant's chunky knit stitches, its red felt heart and black bead eyes exactly as in Picture 1, and keep the giraffe's painted brown spots, red pull-string and black wheels exactly as in Picture 2.",
11 speed="standard",
12 num_images=1,
13 area="4K",
14 aspect_ratio="4:3",
15)
16print(result["status"]) # COMPLETED
17print(result.get("output")) # model output (e.g. media URL)
18print(result["metrics"]["inference_time"]) # server compute seconds
19
20# --- Or submit + poll manually (track request_id, control the cadence) ---
21from segmind import SegmindClient, InferenceFailed, InferenceTimeout
22
23client = SegmindClient() # reads SEGMIND_API_KEY
24payload = {
25 "reference_images": ["https://segmind-resources.s3.amazonaws.com/input/minimax-h3-image-edit-elephant-683ded41.jpg", "https://segmind-resources.s3.amazonaws.com/input/minimax-h3-image-edit-giraffe-1dac0d32.jpg"],
26 "prompt": "Picture 1 is a mustard hand-knitted plush elephant; Picture 2 is a wooden pull-along giraffe. Seat the knitted elephant from Picture 1 upright on the back of the wooden giraffe from Picture 2, on a pale birch nursery shelf with a window of diffused daylight to the left. Keep the elephant's chunky knit stitches, its red felt heart and black bead eyes exactly as in Picture 1, and keep the giraffe's painted brown spots, red pull-string and black wheels exactly as in Picture 2.",
27 "speed": "standard",
28 "num_images": 1,
29 "area": "4K",
30 "aspect_ratio": "4:3",
31}
32job = client.submit_async("minimax-h3-image-edit", **payload)
33print(job.request_id) # available immediately
34try:
35 result = job.wait(timeout=600, interval=1.0)
36except InferenceTimeout as e:
37 print("still running:", e.request_id)
38except InferenceFailed as e:
39 print("failed:", e.detail) 1# pip install "segmind>=1.1.0"
2# export SEGMIND_API_KEY="YOUR_API_KEY"
3import segmind
4
5# Async (v2): submit to the queue and block until COMPLETED.
6# run() returns the final result dict (600s deadline, 1.0s poll by default).
7result = segmind.run(
8 "minimax-h3-image-edit",
9 reference_images=["https://segmind-resources.s3.amazonaws.com/input/minimax-h3-image-edit-elephant-683ded41.jpg", "https://segmind-resources.s3.amazonaws.com/input/minimax-h3-image-edit-giraffe-1dac0d32.jpg"],
10 prompt="Picture 1 is a mustard hand-knitted plush elephant; Picture 2 is a wooden pull-along giraffe. Seat the knitted elephant from Picture 1 upright on the back of the wooden giraffe from Picture 2, on a pale birch nursery shelf with a window of diffused daylight to the left. Keep the elephant's chunky knit stitches, its red felt heart and black bead eyes exactly as in Picture 1, and keep the giraffe's painted brown spots, red pull-string and black wheels exactly as in Picture 2.",
11 speed="standard",
12 num_images=1,
13 area="4K",
14 aspect_ratio="4:3",
15)
16print(result["status"]) # COMPLETED
17print(result.get("output")) # model output (e.g. media URL)
18print(result["metrics"]["inference_time"]) # server compute seconds
19
20# --- Or submit + poll manually (track request_id, control the cadence) ---
21from segmind import SegmindClient, InferenceFailed, InferenceTimeout
22
23client = SegmindClient() # reads SEGMIND_API_KEY
24payload = {
25 "reference_images": ["https://segmind-resources.s3.amazonaws.com/input/minimax-h3-image-edit-elephant-683ded41.jpg", "https://segmind-resources.s3.amazonaws.com/input/minimax-h3-image-edit-giraffe-1dac0d32.jpg"],
26 "prompt": "Picture 1 is a mustard hand-knitted plush elephant; Picture 2 is a wooden pull-along giraffe. Seat the knitted elephant from Picture 1 upright on the back of the wooden giraffe from Picture 2, on a pale birch nursery shelf with a window of diffused daylight to the left. Keep the elephant's chunky knit stitches, its red felt heart and black bead eyes exactly as in Picture 1, and keep the giraffe's painted brown spots, red pull-string and black wheels exactly as in Picture 2.",
27 "speed": "standard",
28 "num_images": 1,
29 "area": "4K",
30 "aspect_ratio": "4:3",
31}
32job = client.submit_async("minimax-h3-image-edit", **payload)
33print(job.request_id) # available immediately
34try:
35 result = job.wait(timeout=600, interval=1.0)
36except InferenceTimeout as e:
37 print("still running:", e.request_id)
38except InferenceFailed as e:
39 print("failed:", e.detail)API Endpoint
https://api.segmind.com/v1/minimax-h3-image-editParameters
promptrequiredstringWhat to change and what must stay the same, up to 32,000 characters; refer to inputs as Picture 1, Picture 2. State both the edit and what to preserve.
"Picture 1 is a mustard hand-knitted plush elephant; Picture 2 is a wooden pull-along giraffe. Seat the knitted elephant from Picture 1 upright on the back of the wooden giraffe from Picture 2, on a pale birch nursery shelf with a window of diffused daylight to the left. Keep the elephant's chunky knit stitches, its red felt heart and black bead eyes exactly as in Picture 1, and keep the giraffe's painted brown spots, red pull-string and black wheels exactly as in Picture 2."reference_imagesrequiredstring[]1 to 16 images (JPG, PNG, WEBP or HEIC) to edit or combine; name each as Picture 1, Picture 2 in the prompt, in upload order. Use clean, well-lit shots of every subject.
["https://segmind-resources.s3.amazonaws.com/input/minimax-h3-image-edit-elephant-683ded41.jpg","https://segmind-resources.s3.amazonaws.com/input/minimax-h3-image-edit-giraffe-1dac0d32.jpg"]areaoptionalstringOutput detail: about 1, 4 or 16 megapixels (1K, 2K or 4K). 4K for print-grade detail, 2K for faster iterations.
"4K""1K""2K""4K"aspect_ratiooptionalstringOutput shape; auto infers it from the prompt and references. Set a ratio such as 4:3 or 16:9 for predictable framing.
"auto""auto""1:1""4:3""3:4""3:2""2:3""16:9""9:16""21:9""9:21"+2 morenum_imagesoptionalintegerNumber of images per request, 1 to 10. Use 1 for a final edit, more to compare variations.
1Range: 1 - 10output_compressionoptionalintegerJPEG or WEBP quality, 0 to 100 (ignored for png). 90 to 95 keeps detail at a smaller size.
95Range: 0 - 100output_formatoptionalstringImage file format. jpeg for photographs, png for lossless, webp for small files.
"jpeg""jpeg""png""webp"sizeoptionalstringOptional exact WIDTHxHEIGHT instead of area and aspect ratio (655,360 to 20,000,000 px, ratio 1:3 to 3:1).
speedoptionalstringstandard is the base model; highspeed returns faster. Use standard for the best quality, highspeed when turnaround matters more.
"standard""standard""highspeed"Response Type
Returns: Image
Asynchronous requests (v2)
Use Async for video, long-running (>~60s), or high-concurrency workloads; Sync is simplest for fast image & LLM calls. Async submits a request and you poll it to completion.
- 1
POST /v2/minimax-h3-image-editSubmit — returns request_id, status_url, response_url
- 2
GET /v2/requests/{id}/statusPoll — until COMPLETED or FAILED
- 3
GET /v2/requests/{id}Result — final response body
Status states
- A FAILED request is served as HTTP 422 — the body still carries the error detail.
- An unknown or expired request_id returns HTTP 404.
- Results are retained for 1 hour, then expire.
- Content / RAI blocks surface as FAILED, not a separate state.
- Track completion by polling the status endpoint.
Common Error Codes
The API returns standard HTTP status codes. Detailed error messages are provided in the response body.
Bad Request
Invalid parameters or request format
Unauthorized
Missing or invalid API key
Forbidden
Insufficient permissions
Not Found
Model or endpoint not found
Insufficient Credits
Not enough credits to process request
Rate Limited
Too many requests
Server Error
Internal server error
Bad Gateway
Service temporarily unavailable
Timeout
Request timed out