# MiniMax H3 Image Text to Image

> MiniMax H3 Image generates detailed images from text prompts, with precise instruction following across photorealistic scenes, illustrations, and visual designs. It supports native high-resolution generation up to 20 megapixels and optional prompt expansion that develops short prompts into complete image descriptions.


## Overview

- **Endpoint**: `https://fal.run/minimax/h3-image/text-to-image`
- **Model ID**: `minimax/h3-image/text-to-image`
- **Category**: text-to-image
- **Kind**: inference
**Tags**: text-to-image, high-resolution, prompt-expansion



## Pricing

Billed on MiniMax token usage: $2.30 per 1M input text tokens, $1.50 per 1M input image tokens and $3.80 per 1M output image tokens.

For more details, see [fal.ai pricing](https://fal.ai/pricing).

## API Information

This model can be used via our HTTP API or more conveniently via our client libraries.
See the input and output schema below, as well as the usage examples.


### Input Schema

The API accepts the following input parameters:


- **`prompt`** (`string`, _required_):
  The prompt to generate an image from. With prompt expansion on, it is rewritten into the long, complete description the model works best with; with it off, it is used verbatim.
  - Examples: "A rustic farm-to-table feast on a weathered wooden table, overhead food photograph, warm side light"

- **`image_size`** (`ImageSize | Enum`, _optional_):
  The exact output size. Output area must be 655360 to 20000000 pixels, inclusive, with aspect ratio between 1:3 and 3:1, inclusive.
  - Default: `{"height":2048,"width":2048}`
  - One of: ImageSize | Enum

- **`num_images`** (`integer`, _optional_):
  The number of images to generate, all from one expanded prompt. Default value: `1`
  - Default: `1`
  - Range: `1` to `10`

- **`enable_prompt_expansion`** (`boolean`, _optional_):
  Rewrite the prompt with a language model into a detailed image description before generation. If expansion fails, the request fails instead of generating from the unexpanded prompt. Default value: `true`
  - Default: `true`

- **`output_format`** (`OutputFormatEnum`, _optional_):
  The format of the generated image. Default value: `"png"`
  - Default: `"png"`
  - Options: `"jpeg"`, `"png"`, `"webp"`, `"jpg"`

- **`sync_mode`** (`boolean`, _optional_):
  If `True`, the media will be returned as a data URI and the output data won't be available in the request history.
  - Default: `false`



**Required Parameters Example**:

```json
{
  "prompt": "A rustic farm-to-table feast on a weathered wooden table, overhead food photograph, warm side light"
}
```

**Full Example**:

```json
{
  "prompt": "A rustic farm-to-table feast on a weathered wooden table, overhead food photograph, warm side light",
  "image_size": {
    "height": 2048,
    "width": 2048
  },
  "num_images": 1,
  "enable_prompt_expansion": true,
  "output_format": "png"
}
```


### Output Schema

The API returns the following output format:

- **`images`** (`list<ImageFile>`, _required_):
  The generated images.
  - Array of ImageFile

- **`usage`** (`ImageUsage`, _optional_):
  Validated successful-image token usage, including prompt enhancement in input text tokens.

- **`actual_prompt`** (`string`, _optional_):
  The expanded prompt when available; null when expansion was disabled or the partner omitted it.

- **`has_nsfw_concepts`** (`list<boolean>`, _required_):
  Whether each generated image was flagged by the safety checker.
  - Array of boolean

- **`timings`** (`Timings`, _required_):
  Seconds spent in each generation stage.



**Example Response**:

```json
{
  "images": [
    {
      "url": "",
      "content_type": "image/png",
      "file_name": "z9RV14K95DvU.png",
      "file_size": 4404019
    }
  ]
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/minimax/h3-image/text-to-image \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "prompt": "A rustic farm-to-table feast on a weathered wooden table, overhead food photograph, warm side light"
   }'
```

### Python

Ensure you have the Python client installed:

```bash
pip install fal-client
```

Then use the API client to make requests:

```python
import fal_client

def on_queue_update(update):
    if isinstance(update, fal_client.InProgress):
        for log in update.logs:
           print(log["message"])

result = fal_client.subscribe(
    "minimax/h3-image/text-to-image",
    arguments={
        "prompt": "A rustic farm-to-table feast on a weathered wooden table, overhead food photograph, warm side light"
    },
    with_logs=True,
    on_queue_update=on_queue_update,
)
print(result)
```

### JavaScript

Ensure you have the JavaScript client installed:

```bash
npm install --save @fal-ai/client
```

Then use the API client to make requests:

```javascript
import { fal } from "@fal-ai/client";

const result = await fal.subscribe("minimax/h3-image/text-to-image", {
  input: {
    prompt: "A rustic farm-to-table feast on a weathered wooden table, overhead food photograph, warm side light"
  },
  logs: true,
  onQueueUpdate: (update) => {
    if (update.status === "IN_PROGRESS") {
      update.logs.map((log) => log.message).forEach(console.log);
    }
  },
});
console.log(result.data);
console.log(result.requestId);
```


## Deploy your own model

To run your own weights, a fine-tune or a custom pipeline on the GPUs that serve this API, deploy it on fal Serverless. GPUs from H100 (80GB) to B300 (288GB), billed per second; an H100 is $4.50/h list, as low as $2.49/h. Prices, GPU specs and deploy steps: [fal Serverless](https://fal.ai/serverless.md).

## Additional Resources

### Documentation

- [Model Playground](https://fal.ai/models/minimax/h3-image/text-to-image)
- [API Documentation](https://fal.ai/models/minimax/h3-image/text-to-image/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=minimax/h3-image/text-to-image)

### fal.ai Platform

- [Platform Documentation](https://fal.ai/docs/documentation)
- [Python Client](https://fal.ai/docs/api-reference/client-libraries/python)
- [JavaScript Client](https://fal.ai/docs/api-reference/client-libraries/javascript)

### Other agent-readable surfaces

This file covers one model. To find anything else:

- [Platform overview](https://fal.ai/llms.txt): Entry points and representative endpoint IDs
- [Documentation index](https://fal.ai/docs/llms.txt): Every documentation page
- [Full documentation text](https://fal.ai/docs/llms-full.txt): The whole documentation inlined
- [Pricing](https://fal.ai/pricing.md): Model API and Serverless GPU prices
- [fal Serverless](https://fal.ai/serverless.md): Deploy your own models: GPU prices, specs and steps
- Any other model: `https://fal.ai/models/<endpoint-id>/llms.txt`
