live
MODEL IDminimax:h3@image

MiniMax H3 Image

MiniMax
by

MiniMax H3 Image is an open-weights image generation and editing model from MiniMax. It creates images from text or edits and combines up to 16 reference images, at 1K, 2K or 4K, or at a custom width and height up to 20 megapixels. It follows counts, positions and layouts closely and renders long, dense text, which suits product and marketing visuals, posters and infographics, concept art, and compositions that merge several subjects.

MiniMax H3 Image

Multi-reference composition

How to compose one image from up to 16 references with MiniMax H3 Image: giving each image a role, borrowing color, following a layout sketch and furnishing a room.

Introduction

A campaign image normally needs the athlete and every product in front of one camera, on location, on the same morning. When the jacket is still a sample and the shoes ship next month, the shoot waits for them.

MiniMax H3 Image composes the image from separate photos instead. Each photo goes into inputs.referenceImages, up to 16 per request, and the prompt gives each image a role, so one supplies the runner and another the track she runs on. The model returns one frame with every piece posed and lit together.

Built from 4 references
  • Image 1: runner
  • Image 2: jacket
  • Image 3: shoes
  • Image 4: location

For a sportswear brand, the result is a campaign image built from a casting photo, two packshots and a location photo, and next season's colorway is one more packshot in image 2.

This guide covers the request, giving each image a role, borrowing color from a reference, following a layout sketch, furnishing a room from eight product photos and sizing the output. Changing a single image with an instruction, and editing a result over several rounds, are covered in editing images. How to structure the prompt itself is covered in prompting.

The request

References go into inputs.referenceImages, and the prompt refers to them by their position in the array:

Try in Playground
import { createClient } from '@runware/sdk'

const client = await createClient({ apiKey: process.env.RUNWARE_API_KEY })
await client.connect()

const [result] = await client.run({
  model: 'minimax:h3@image',
  positivePrompt: 'The woman from image 1 wearing the jacket from image 2, zipped halfway, and the running shoes from image 3, jogging toward the camera along the rooftop track from image 4. Keep her face, hair and build, and the running tights from image 1. Keep the cut, color, fabric and piping of the jacket from image 2, and the shape, colors and sole of the shoes from image 3. Her stride and expression can change. Relight her with the dawn light of image 4, with a soft shadow on the track beneath her. Full-length shot from a low angle, 85mm lens. Photoreal sportswear campaign photography.',
  width: 1600,
  height: 2400,
  inputs: {
    referenceImages: [
      'https://assets.runware.ai/guides/minimax-h3-image/multi-reference-composition/source-hero-person.jpg',
      'https://assets.runware.ai/guides/minimax-h3-image/multi-reference-composition/source-hero-garment.jpg',
      'https://assets.runware.ai/guides/minimax-h3-image/multi-reference-composition/source-hero-footwear.jpg',
      'https://assets.runware.ai/guides/minimax-h3-image/multi-reference-composition/source-hero-location.jpg'
    ]
  }
})
import asyncio
import os

from runware import Runware


async def main():
    async with Runware(api_key=os.environ["RUNWARE_API_KEY"]) as client:
        results = await client.run({
            "model": "minimax:h3@image",
            "positivePrompt": "The woman from image 1 wearing the jacket from image 2, zipped halfway, and the running shoes from image 3, jogging toward the camera along the rooftop track from image 4. Keep her face, hair and build, and the running tights from image 1. Keep the cut, color, fabric and piping of the jacket from image 2, and the shape, colors and sole of the shoes from image 3. Her stride and expression can change. Relight her with the dawn light of image 4, with a soft shadow on the track beneath her. Full-length shot from a low angle, 85mm lens. Photoreal sportswear campaign photography.",
            "width": 1600,
            "height": 2400,
            "inputs": {
                "referenceImages": [
                    "https://assets.runware.ai/guides/minimax-h3-image/multi-reference-composition/source-hero-person.jpg",
                    "https://assets.runware.ai/guides/minimax-h3-image/multi-reference-composition/source-hero-garment.jpg",
                    "https://assets.runware.ai/guides/minimax-h3-image/multi-reference-composition/source-hero-footwear.jpg",
                    "https://assets.runware.ai/guides/minimax-h3-image/multi-reference-composition/source-hero-location.jpg"
                ]
            }
        })


asyncio.run(main())
curl https://api.runware.ai/v1 \
  -H "Authorization: Bearer $RUNWARE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "taskType": "imageInference",
      "taskUUID": "9bcafd4e-adde-4b68-b551-42a08a3b682d",
      "model": "minimax:h3@image",
      "positivePrompt": "The woman from image 1 wearing the jacket from image 2, zipped halfway, and the running shoes from image 3, jogging toward the camera along the rooftop track from image 4. Keep her face, hair and build, and the running tights from image 1. Keep the cut, color, fabric and piping of the jacket from image 2, and the shape, colors and sole of the shoes from image 3. Her stride and expression can change. Relight her with the dawn light of image 4, with a soft shadow on the track beneath her. Full-length shot from a low angle, 85mm lens. Photoreal sportswear campaign photography.",
      "width": 1600,
      "height": 2400,
      "inputs": {
        "referenceImages": [
          "https://assets.runware.ai/guides/minimax-h3-image/multi-reference-composition/source-hero-person.jpg",
          "https://assets.runware.ai/guides/minimax-h3-image/multi-reference-composition/source-hero-garment.jpg",
          "https://assets.runware.ai/guides/minimax-h3-image/multi-reference-composition/source-hero-footwear.jpg",
          "https://assets.runware.ai/guides/minimax-h3-image/multi-reference-composition/source-hero-location.jpg"
        ]
      }
    }
  ]'
runware run minimax:h3@image \
  positivePrompt="The woman from image 1 wearing the jacket from image 2, zipped halfway, and the running shoes from image 3, jogging toward the camera along the rooftop track from image 4. Keep her face, hair and build, and the running tights from image 1. Keep the cut, color, fabric and piping of the jacket from image 2, and the shape, colors and sole of the shoes from image 3. Her stride and expression can change. Relight her with the dawn light of image 4, with a soft shadow on the track beneath her. Full-length shot from a low angle, 85mm lens. Photoreal sportswear campaign photography." \
  width=1600 \
  height=2400 \
  inputs.referenceImages.0=https://assets.runware.ai/guides/minimax-h3-image/multi-reference-composition/source-hero-person.jpg \
  inputs.referenceImages.1=https://assets.runware.ai/guides/minimax-h3-image/multi-reference-composition/source-hero-garment.jpg \
  inputs.referenceImages.2=https://assets.runware.ai/guides/minimax-h3-image/multi-reference-composition/source-hero-footwear.jpg \
  inputs.referenceImages.3=https://assets.runware.ai/guides/minimax-h3-image/multi-reference-composition/source-hero-location.jpg
{
  "taskType": "imageInference",
  "taskUUID": "9bcafd4e-adde-4b68-b551-42a08a3b682d",
  "model": "minimax:h3@image",
  "positivePrompt": "The woman from image 1 wearing the jacket from image 2, zipped halfway, and the running shoes from image 3, jogging toward the camera along the rooftop track from image 4. Keep her face, hair and build, and the running tights from image 1. Keep the cut, color, fabric and piping of the jacket from image 2, and the shape, colors and sole of the shoes from image 3. Her stride and expression can change. Relight her with the dawn light of image 4, with a soft shadow on the track beneath her. Full-length shot from a low angle, 85mm lens. Photoreal sportswear campaign photography.",
  "width": 1600,
  "height": 2400,
  "inputs": {
    "referenceImages": [
      "https://assets.runware.ai/guides/minimax-h3-image/multi-reference-composition/source-hero-person.jpg",
      "https://assets.runware.ai/guides/minimax-h3-image/multi-reference-composition/source-hero-garment.jpg",
      "https://assets.runware.ai/guides/minimax-h3-image/multi-reference-composition/source-hero-footwear.jpg",
      "https://assets.runware.ai/guides/minimax-h3-image/multi-reference-composition/source-hero-location.jpg"
    ]
  }
}
Response
[
  {
    "taskType": "imageInference",
    "taskUUID": "9bcafd4e-adde-4b68-b551-42a08a3b682d",
    "imageUUID": "db6ffc06-ea16-4a28-b97c-be7545afb457",
    "imageURL": "https://im.runware.ai/image/os/a14d18/ws/2/ii/db6ffc06-ea16-4a28-b97c-be7545afb457.jpg"
  }
]
  • The array order is the numbering. "Image 1" in the prompt is the first entry of inputs.referenceImages, and "image 4" is the fourth.
  • Each reference is a URL, a UUID (a previous generation's, or one uploaded via Media Storage), a data URI or a base64 string, in JPEG, PNG, WebP, HEIC or HEIF.
  • Each one needs 128 to 8,192 pixels per side, a long side no more than four times the short one, and a file of up to 64 MiB.
  • Requests with references always run the prompt optimizer, which rewrites the prompt into a detailed scene description before generating. Setting settings.promptOptimizer to false alongside references is rejected.

Giving each image a role

A reference arrives as a photo and nothing more. A bathroom shelf could be the place to stand the product or only the light to copy, so the prompt assigns each image its role: what it contributes, what has to stay as it is and what is free to change.

Built from 2 references
  • Image 1: product
  • Image 2: setting

The prompt, clause by clause:

Use image 2 as the setting and the serum bottle from image 1 as the product, Stand the bottle on the shelf in the empty space between the towel and the plant, Keep the shape, glass, dropper and label of the bottle from image 1, and keep the shelf, the window and the objects of image 2 where they are, The angle of the bottle and the camera distance can change, Relight the bottle with the morning sun of image 2, with a soft shadow on the marble, Photoreal beauty product photography, shallow depth of field
RolesPlacementKeepCan changeLightStyle

Four habits keep the roles from crossing:

  • Name each image by number and noun. "The serum bottle from image 1" says which entry to read and what to look for in it.
  • List what stays as categories. The prompt keeps the shape, glass, dropper and label of the bottle without naming a single color. The look is already in image 1, and describing it again in words hands the model a second version to reconcile with the picture.
  • Say what is free to change. The angle of the bottle and the camera distance are left open, so the bottle can turn toward the window light instead of holding its packshot pose.
  • Take the light from the setting. A packshot carries the light of the studio it was shot in. Pointing at the morning sun of image 2 and asking for a shadow on the marble is what seats the bottle on the shelf.

Roles stack the same way at any count. "Keep the product from image 1, use image 2 for color and image 3 for layout" is three references and three clauses, one job each.

Borrowing color from a reference

A reference can contribute only its colors. A mood photo or a material swatch sets a new colorway, and the product keeps everything else:

Built from 2 references
  • Image 1: product
  • Image 2: color

Two clauses scope the color reference:

  • Rank the colors instead of naming them. "The dominant color of image 2" and "its darkest color" hand each color to a part of the backpack without a shade name in the prompt. A different swatch in image 2 gives a different colorway with the prompt unchanged.
  • Give the reference one job. "Take only the colors from image 2" limits the tiles to their colors, and the canvas came back with its own texture and no tile pattern.

Following a layout sketch

A rough sketch can fix the composition on its own. Draw the layout as labeled boxes, pass the drawing with the product, and let the prompt fill each box:

Built from 2 references
  • Image 1: product
  • Image 2: layout

The labels become handles. The prompt says "where image 2 says HEADLINE" instead of describing a position, and quotes the copy that goes in each box. To move the product to the other side of the banner, redraw the sketch and leave the prompt as it is.

Draw the sketch in the shape of the output. The wireframe is 2688 × 1152, the size the banner was requested at, so each box keeps its proportions in the result. The closing clause limits image 2 to its positions and proportions, and the finished banner came back with clean type where the handwriting was.

Furnishing a room from eight products

The array takes up to 16 references, enough to furnish a room from a catalog. The living room below is built from eight furniture packshots, one per piece:

Built from 8 references
  • Image 1: sofa
  • Image 2: coffee table
  • Image 3: rug
  • Image 4: armchair
  • Image 5: floor lamp
  • Image 6: side table
  • Image 7: tree
  • Image 8: print
  • One placement clause per product. Each piece is placed against the room or against another piece: the sofa against the back wall and the coffee table on the rug. A list of products with no positions leaves the floor plan to the model.
  • Exactly once, at natural size. A packshot carries no scale, so the side table and the sofa each fill their own square. "At natural sizes relative to the room" sizes them against each other, and "each shown exactly once" keeps a piece from being doubled or dropped.
  • The room is in the prompt. None of the eight references shows a room, so the prompt describes the walls, the floor, the window and the light.

Each reference image adds about 2,050 input tokens to the request, so eight add about 16,400 and the full 16 about 33,000.

Output size

With references in the request, the size comes from one of three places:

Request sendsOutput
No size4K
resolution (1K, 2K or 4K)That tier, in the shape of the references
width and heightExactly those pixels, whatever the shape of the references

The serum request sends resolution:

Try in Playground
import { createClient } from '@runware/sdk'

const client = await createClient({ apiKey: process.env.RUNWARE_API_KEY })
await client.connect()

const [result] = await client.run({
  model: 'minimax:h3@image',
  positivePrompt: 'Use image 2 as the setting and the serum bottle from image 1 as the product. Stand the bottle on the shelf in the empty space between the towel and the plant. Keep the shape, glass, dropper and label of the bottle from image 1, and keep the shelf, the window and the objects of image 2 where they are. The angle of the bottle and the camera distance can change. Relight the bottle with the morning sun of image 2, with a soft shadow on the marble. Photoreal beauty product photography, shallow depth of field.',
  resolution: '2K',
  inputs: {
    referenceImages: [
      'https://assets.runware.ai/guides/minimax-h3-image/multi-reference-composition/source-roles-product.jpg',
      'https://assets.runware.ai/guides/minimax-h3-image/multi-reference-composition/source-roles-setting.jpg'
    ]
  }
})
import asyncio
import os

from runware import Runware


async def main():
    async with Runware(api_key=os.environ["RUNWARE_API_KEY"]) as client:
        results = await client.run({
            "model": "minimax:h3@image",
            "positivePrompt": "Use image 2 as the setting and the serum bottle from image 1 as the product. Stand the bottle on the shelf in the empty space between the towel and the plant. Keep the shape, glass, dropper and label of the bottle from image 1, and keep the shelf, the window and the objects of image 2 where they are. The angle of the bottle and the camera distance can change. Relight the bottle with the morning sun of image 2, with a soft shadow on the marble. Photoreal beauty product photography, shallow depth of field.",
            "resolution": "2K",
            "inputs": {
                "referenceImages": [
                    "https://assets.runware.ai/guides/minimax-h3-image/multi-reference-composition/source-roles-product.jpg",
                    "https://assets.runware.ai/guides/minimax-h3-image/multi-reference-composition/source-roles-setting.jpg"
                ]
            }
        })


asyncio.run(main())
curl https://api.runware.ai/v1 \
  -H "Authorization: Bearer $RUNWARE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "taskType": "imageInference",
      "taskUUID": "276617b4-8a6f-4be0-b95f-3ad9d017fb3c",
      "model": "minimax:h3@image",
      "positivePrompt": "Use image 2 as the setting and the serum bottle from image 1 as the product. Stand the bottle on the shelf in the empty space between the towel and the plant. Keep the shape, glass, dropper and label of the bottle from image 1, and keep the shelf, the window and the objects of image 2 where they are. The angle of the bottle and the camera distance can change. Relight the bottle with the morning sun of image 2, with a soft shadow on the marble. Photoreal beauty product photography, shallow depth of field.",
      "resolution": "2K",
      "inputs": {
        "referenceImages": [
          "https://assets.runware.ai/guides/minimax-h3-image/multi-reference-composition/source-roles-product.jpg",
          "https://assets.runware.ai/guides/minimax-h3-image/multi-reference-composition/source-roles-setting.jpg"
        ]
      }
    }
  ]'
runware run minimax:h3@image \
  positivePrompt="Use image 2 as the setting and the serum bottle from image 1 as the product. Stand the bottle on the shelf in the empty space between the towel and the plant. Keep the shape, glass, dropper and label of the bottle from image 1, and keep the shelf, the window and the objects of image 2 where they are. The angle of the bottle and the camera distance can change. Relight the bottle with the morning sun of image 2, with a soft shadow on the marble. Photoreal beauty product photography, shallow depth of field." \
  resolution=2K \
  inputs.referenceImages.0=https://assets.runware.ai/guides/minimax-h3-image/multi-reference-composition/source-roles-product.jpg \
  inputs.referenceImages.1=https://assets.runware.ai/guides/minimax-h3-image/multi-reference-composition/source-roles-setting.jpg
{
  "taskType": "imageInference",
  "taskUUID": "276617b4-8a6f-4be0-b95f-3ad9d017fb3c",
  "model": "minimax:h3@image",
  "positivePrompt": "Use image 2 as the setting and the serum bottle from image 1 as the product. Stand the bottle on the shelf in the empty space between the towel and the plant. Keep the shape, glass, dropper and label of the bottle from image 1, and keep the shelf, the window and the objects of image 2 where they are. The angle of the bottle and the camera distance can change. Relight the bottle with the morning sun of image 2, with a soft shadow on the marble. Photoreal beauty product photography, shallow depth of field.",
  "resolution": "2K",
  "inputs": {
    "referenceImages": [
      "https://assets.runware.ai/guides/minimax-h3-image/multi-reference-composition/source-roles-product.jpg",
      "https://assets.runware.ai/guides/minimax-h3-image/multi-reference-composition/source-roles-setting.jpg"
    ]
  }
}
Response
[
  {
    "taskType": "imageInference",
    "taskUUID": "276617b4-8a6f-4be0-b95f-3ad9d017fb3c",
    "imageUUID": "43d27b0b-a394-4e0e-bf03-648829dbe286",
    "imageURL": "https://im.runware.ai/image/os/a14d18/ws/2/ii/43d27b0b-a394-4e0e-bf03-648829dbe286.jpg"
  }
]

Both of its references are 3:2, so the 2K output follows them in the same 3:2 shape.

When the references differ in shape, or the output needs a shape none of them has, send width and height. The hero mixes portrait and square references and asks for 1600 × 2400, and the living room turns eight square packshots into a 2560 × 1440 frame. Exact sizes are generated as given, never scaled or rounded. They run from 655,360 to 20,000,000 pixels in total, with 468 to 7,745 pixels per side and a shape between 1:3 and 3:1. resolution cannot be sent together with them.

Tips

  1. Number every image in the prompt. "The jacket from image 2" maps to the second entry of the array and names what to find there.

  2. Give each reference one role. Product, setting, color or layout, each stated in its own clause, so no image is left for the model to interpret.

  3. Keep parts, not descriptions. List what survives as categories, such as the fabric or the buckles, and leave the colors and shapes to the reference.

  4. Say what may change. A pose or a camera distance left open lets the subject settle into the new scene.

  5. Scope a color reference. Rank its colors onto the parts of the product, and say that color is all it supplies.

  6. Draw a layout in the shape of the output. Label the boxes and point the prompt at the labels.

  7. Place every piece of a large set. One clause per product, each shown exactly once, at natural size.

  8. Send a size. width and height pin the frame when references differ in shape, and a request with no size returns 4K.