Skip to main content
tencent avatar

HunyuanImage 3.0 Instruct API

tencent/hunyuan-image/v3/instruct/text-to-image

Generate high-resolution images from a text prompt with the instruction-tuned HunyuanImage 3.0 checkpoint, built for following long, complex, multi-part descriptions closely.

0.09 per megapixel of image

Model Input

Input

The text prompt describing the image you want to generate.

The size of the generated image. Use a preset, an explicit width/height object, or 'auto' to let the model choose.

Min: 1 - Max: 4

The number of images to generate. Each generated image is billed.

Additional Settings

Customize your input with more control.

Max: 20

The CFG scale. Higher values increase adherence to the prompt.

Whether to enable prompt expansion. This uses a large language model to expand the prompt with additional details while maintaining the original meaning. Enabled by default; disable it to have your exact wording honored.

Random seed for reproducible results. The same seed and prompt produce the same image; leave unset for a random seed.

Safety checker can only be disabled on API call

The format of the generated image.

You need to be logged in to run this model and view results.
Log in

Model Output

Output

Generated image output
Generated in 50.516 seconds
Logs (1 lines)

Model Example Requests

Examples

Example output 1Example output 2Example output 3Example output 4

HunyuanImage 3.0 Instruct API

HunyuanImage 3.0 Instruct is a text-to-image AI model by tencent. On ModelRunner it runs through a REST API or via MCP from any AI assistant, at $0.09 per megapixel.

POST https://queue.modelrunner.run/tencent/hunyuan-image/v3/instruct/text-to-image

cURL

# Submit a request to the queue
curl -X POST https://queue.modelrunner.run/tencent/hunyuan-image/v3/instruct/text-to-image \
  -H "Authorization: Key $MRUN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input": {
      "prompt": "An extreme macro photograph of a dew-covered spiderweb at dawn, each water droplet refracting golden sunrise light li…",
      "image_size": "landscape_16_9",
      "num_images": 1,
      "output_format": "png",
      "guidance_scale": 3.5,
      "enable_safety_checker": true,
      "enable_prompt_expansion": true
    }
  }'
# → { "request_id": "...", "status_url": "...", "response_url": "..." }

# Poll status_url until "COMPLETED", then fetch the result
curl "https://queue.modelrunner.run/tencent/hunyuan-image/v3/instruct/text-to-image/requests/$REQUEST_ID/status" \
  -H "Authorization: Key $MRUN_API_KEY"
curl "https://queue.modelrunner.run/tencent/hunyuan-image/v3/instruct/text-to-image/requests/$REQUEST_ID" \
  -H "Authorization: Key $MRUN_API_KEY"

JavaScript

import { modelrunner } from "@modelrunner/client";

const result = await modelrunner.subscribe("tencent/hunyuan-image/v3/instruct/text-to-image", {
  input: {
    "prompt": "An extreme macro photograph of a dew-covered spiderweb at dawn, each water droplet refracting golden sunrise light li…",
    "image_size": "landscape_16_9",
    "num_images": 1,
    "output_format": "png",
    "guidance_scale": 3.5,
    "enable_safety_checker": true,
    "enable_prompt_expansion": true
  },
});
console.log(result);

Python

import os
import requests

headers = {"Authorization": f"Key {os.environ['MRUN_API_KEY']}"}

submitted = requests.post(
    "https://queue.modelrunner.run/tencent/hunyuan-image/v3/instruct/text-to-image",
    headers=headers,
    json={"input": {
      "prompt": "An extreme macro photograph of a dew-covered spiderweb at dawn, each water droplet refracting golden sunrise light li…",
      "image_size": "landscape_16_9",
      "num_images": 1,
      "output_format": "png",
      "guidance_scale": 3.5,
      "enable_safety_checker": true,
      "enable_prompt_expansion": true
    }},
).json()

# Poll submitted["status_url"] until "COMPLETED", then:
result = requests.get(submitted["response_url"], headers=headers).json()

Input parameters

NameTypeRequiredDescription
promptstringyesThe text prompt describing the image you want to generate.
image_sizeenumnoThe size of the generated image. Use a preset, an explicit width/height object, or 'auto' to let the model choose. Default: "auto".
num_imagesintegernoThe number of images to generate. Each generated image is billed. Default: 1.
guidance_scalenumbernoThe CFG scale. Higher values increase adherence to the prompt. Default: 3.5.
enable_prompt_expansionbooleannoWhether to enable prompt expansion. This uses a large language model to expand the prompt with additional details while maintaining the original meaning. Enabled by default; disable it to have your exact wording honored. Default: true.
seedintegernoRandom seed for reproducible results. The same seed and prompt produce the same image; leave unset for a random seed.
enable_safety_checkerbooleannoIf set to true, the safety checker will be enabled. Default: true.
output_formatenumnoThe format of the generated image. Default: "png".

Machine-readable: OpenAPI schema · llms.txt

Use HunyuanImage 3.0 Instruct from Claude & Cursor (MCP)

Point Claude Code, Claude Desktop, Cursor, or any MCP client at the ModelRunner MCP server and HunyuanImage 3.0 Instruct becomes a tool your assistant can call directly — it authorizes via OAuth (no API key in config) and runs this model with the run_model tool using the endpoint tencent/hunyuan-image/v3/instruct/text-to-image.

MCP client config (Claude Desktop, Cursor)

{
  "mcpServers": {
    "modelrunner": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://mcp.modelrunner.run/mcp"]
    }
  }
}

Claude Code

claude mcp add --transport http modelrunner https://mcp.modelrunner.run/mcp

Then ask your assistant, for example: “Run tencent/hunyuan-image/v3/instruct/text-to-image on ModelRunner to generate image”. MCP setup guide.

Model Details

Model Details

HunyuanImage 3.0 Instruct turns a text prompt into a high-quality image. It is the instruction-tuned checkpoint of the 80-billion-parameter HunyuanImage 3.0 foundation model, with internal reasoning that parses long, complex, multi-part prompts and lays out the scene before rendering — so when you spell out several subjects, spatial relationships, lighting, and style in one prompt, the result tracks each instruction more faithfully than a raw diffusion pass. Set the aspect ratio with `image_size` (presets like `square_hd`, `portrait_16_9`, `landscape_16_9`, an explicit `{width, height}`, or `auto` to let the model choose), and generate up to four variations per call with `num_images`.

Prompt expansion is on by default here: a language model fleshes out terse prompts before generation. Set `enable_prompt_expansion` to `false` when you want your exact wording honored verbatim. This variant does not expose a negative prompt or a denoising-step control — the reasoning step handles that internally — so it is tuned for describing what you want rather than steering the sampler.

## Best for - Long, richly specified prompts where several subjects, spatial layout, lighting, and mood all need to land together - Complex, multi-part instructions that a plain text-to-image model tends to drop parts of - Photorealistic and stylized images from a detailed written description - Concept art, editorial illustration, posters, and marketing visuals from a brief - Generating a few composition variants at once to pick from, at non-square aspect ratios

## Choose another model when - You want to edit, restyle, or modify an existing image rather than generate from scratch — use an image-editing model - You have a reference photo to transform and want to keep its structure — use an image-to-image model - You need negative-prompt or inference-step control to steer the sampler directly — this variant does not expose them; use the base HunyuanImage 3.0 text-to-image variant - You need the cheapest, fastest drafts and can trade some fidelity — use a distilled fast text-to-image model - You need video — use a text-to-video or image-to-video model

## Tips - Write specific, descriptive prompts and state each requirement explicitly; the reasoning step rewards structured, complete instructions over short keyword lists - Leave `enable_prompt_expansion` on (the default) for short briefs; set it to `false` when your prompt is already precise and you want it honored word-for-word - Use `image_size` presets for common aspect ratios, pass an explicit `{width, height}` object for a precise canvas, or use `auto` to let the model pick dimensions - Each generated image is billed by megapixel, so larger sizes and higher `num_images` cost more

To run via the ModelRunner JavaScript client: ```js import { modelrunner } from "@modelrunner/client";

const result = await modelrunner.subscribe("tencent/hunyuan-image/v3/instruct/text-to-image", { input: { prompt: "a snow leopard on a rocky ledge at golden hour, telephoto compression, sharp fur detail, cinematic lighting", image_size: "landscape_16_9", num_images: 1, output_format: "png", }, }); ```