Tencent
Hunyuan Image 3.0
hunyuan-image-3.0/instruct-edit
Tencent Hunyuan image model that supports long Chinese and English prompts and text rendering within images, and can generate images from text or edit reference images by instruction, making it suitable for e-commerce visuals, advertising creative, and poster layout
Try hunyuan-image-3.0/instruct-edit
Input
Output
Pricing
hunyuan-image-3.0/instruct-edit $0.1349 $0.10792 per image
Positioning Overview
The instruction-based image editing line of Tencent Hunyuan Image 3.0, aimed at developers and design teams that need targeted modifications, local replacements, or style adjustments on existing images. Upload 1 to 3 reference images and describe the intended modification in text to output an edited still image; generate 1 to 4 images per request, with five fixed aspect-ratio presets at roughly the 1MP level and PNG and JPEG formats, plus support for random seeds, instruction-following strength, and automatic prompt expansion.
Core Highlights
- Edit existing images directly with natural language — text editing instructions drive image-to-image generation, completing local replacement, recoloring, or background adjustment while preserving the original composition and subject relationships.
- Up to 3 reference images in order — submit 1 to 3 images per request, used as references in upload order, making it convenient to retouch by comparison or combine elements from multiple assets.
- Controllable following strength and seed — instruction-following strength is adjustable from 2 to 20, balancing strict execution of the modification against preserving original image details; a fixed integer seed makes similar results reproducible.
- Aspect ratio and batch set at once — five fixed aspect-ratio presets at roughly the 1MP level and batches of 1 to 4 images, with PNG and JPEG output, billed by the actual number of images.
Capability Description
- Edit images with text instructions: submit 1 to 3 accessible image links plus an editing instruction (up to 8000 characters) to modify specified objects, colors, backgrounds, or styles and return a still image.
- Process multiple reference images in order: multiple image inputs are used as references in array order, suited to targeted retouching tasks that combine a main image with additional reference assets.
- Five aspect ratios and two output formats: choose one of five presets at roughly the 1MP level — square 1:1 (default), portrait 4:3, portrait 16:9, landscape 4:3, landscape 16:9 — with PNG (default) or JPEG format.
- Batch generation and parameter fine-tuning: generate 1 to 4 images per request (default 1), billed per image; instruction-following strength ranges from 2 to 20 (default 3.5), and random seeds help with multi-round comparison and selection.
- Automatic prompt expansion: automatic expansion (enable_prompt_expansion) is enabled by default, and the model completes the editing description before executing; disable it when edits must follow the original wording strictly.
Applicable Scenarios
- E-commerce product image recoloring and background replacement — upload real product photos, replace backgrounds or adjust color schemes with instructions, and batch-generate multiple candidates for detail pages and campaign assets.
- Social media images reformatted per platform — issue modification instructions based on existing posters or cover images and output PNG or JPEG in the target aspect ratio, quickly adapting to different placements.
- Iterating design drafts per review feedback — feed an initial draft and specific revision notes to editing instructions and fix the seed to generate 1 to 4 images each time for internal version comparison.
- Combining elements and styles from multiple reference images — upload 2 to 3 reference images and combine them in order, introducing reference styles or replacing local elements while preserving the subject structure.
Limitations and Selection Advice
This line only supports instruction-based editing based on reference images and does not offer pure text-to-image generation from scratch; to generate from scratch, switch to the hunyuan-image-3.0/text-to-image line in the same series. Each request must provide 1 to 3 accessible image links, with a prompt limit of 8000 characters; 1 to 4 images are generated and billed per image. Guidance strength ranges from 2 to 20 (default 3.5); setting it too high may lose original image details; this line does not support negative prompts or inference step parameters. Aspect ratio uses five fixed-ratio presets at roughly the 1MP level (square by default) and does not support custom pixel dimensions; automatic expansion is enabled by default, so disable it when edits must follow the exact wording.
What's new
View changelog →- New model New model launch: Hunyuan Image 3.0 (text-to-image, instruct-edit)
Frequently asked questions
View all FAQs →-
How many images can this model generate at once?
Up to 4 images per request, set with num_images; the default is 1 image, billed per image. When you want to compare multiple options, setting it to 4 is simpler than making several requests; if you just want to check whether the direction is right, first use 1 image to validate the prompt, then generate in batches.
-
How do I choose the canvas size and aspect ratio?
Use image_size to choose a preset: square_hd (1:1), portrait_4_3, portrait_16_9, landscape_4_3, landscape_16_9; the default is square_hd. For vertical portraits, choose portrait_4_3 to better fit the composition; for horizontal scenes or banners, choose landscape_16_9. All sizes are at roughly the 1MP level; once the ratio is decided, then adjust the composition content.
-
How should I write prompts to get stable results?
Write in the order of "subject + attributes + action + scene + lighting + composition + style", in either Chinese or English, with a maximum length of 8000 characters. This model follows prompts fairly strictly, so spelling out all the elements is more effective than leaving room for imagination; when you need text in the image, write the characters to appear directly into the prompt and specify their position. Rendering accuracy is high for Chinese and English, but not guaranteed for other languages.
-
What should guidance_scale be set to?
For text-to-image, the default is 7.5 with a range of 1–20; for image editing, the default is 3.5 with a range of 2–20. If you want the image to follow the prompt more closely or adhere more strictly to the editing instructions, raise it, but too high a value sacrifices naturalness or loses detail from the original image; if you want to leave more room for interpretation, lower it. It is recommended to first fix one value and run the same prompt, and once you confirm it is stable, fine-tune it, to avoid changing multiple parameters at the same time.
Create a generation task
https://api.hiapi.sh/v1/tasks Headers
AuthorizationstringRequiredAccount API key. Required on every request. Example: Bearer YOUR_HIAPI_API_KEY. Get your API key
Content-TypestringOptionalThe request body is always parsed as JSON; when sent, only application/json (optionally with charset) is accepted — any other value returns 415. Example: application/json.
Idempotency-KeystringOptionalIdempotency key, up to 255 bytes. Retries with the same key from the same account create the task only once; replays return the original taskId.
On network timeouts or client retries, the same key creates the task only once — no double charges (scope: the API key's account). Use a business-unique identifier as the key (e.g. "order-42"); replays return the original taskId, and keys expire 24 hours after the first request. See the Unified Async API overview for the full scenario matrix.
Body
modelstringRequiredCurrent fixed value: hunyuan-image-3.0/instruct-edit
routestringOptionalCurrent fixed value: default
inputobjectRequired
Business parameters for hunyuan-image-3.0/instruct-edit and route default — see the parameter table below.
seedintegerOptionalRandom seed, integer. Fixing this value reproduces similar generation results; if left blank, it is random each time.
promptstringRequiredmaxLength 8000Edit instruction, required string, up to 8000 characters, describing the modifications to make to the original image, for example changing a red cup to blue.
image_sizestringOptionalDefault: "square_hd"Output aspect ratio preset, roughly 1MP level, defaults to square_hd (square 1:1); options are square_hd, portrait_4_3, portrait_16_9, landscape_4_3, landscape_16_9.
square_hdportrait_4_3portrait_16_9landscape_4_3landscape_16_9image_urlsarrayRequiredminItems 1maxItems 3Array of reference images, required, 1–3 images, each element is the URL of an image to be edited; when multiple are passed, they are used as references in order.
Array [ string ]
num_imagesintegerOptionalDefault: 1min 1max 4Number of images to generate at once, integer, range 1–4, billed per image, default 1.
output_formatstringOptionalDefault: "png"File format of the output images, options are png or jpeg, default png.
pngjpegguidance_scalenumberOptionalDefault: 3.5min 2max 20Instruction-following strength, numeric, range 2–20, default 3.5. Higher values follow the edit instruction more strictly; too high may lose details of the original image.
enable_prompt_expansionbooleanOptionalDefault: trueWhether to automatically expand the instruction, boolean, default true; when enabled, the model first expands the edit instruction before executing it.
callbackobjectOptional
Terminal-state notification config. When omitted, no callback is delivered — poll the task yourself. See the callback note below.
Provide callback.url when creating a task and HiAPI POSTs to your service once the task reaches a terminal state — no polling needed. The callback payload mirrors the task detail structure; signature verification, delivery retries and idempotency are documented on the Unified Async API overview page.
urlstringRequiredRequired when callback is present. A POST is sent to this URL once the task reaches a terminal state; must be a valid http(s) URL.
whenstringOptionalDefault: "final"Only final is supported today — notified on both success and fail.
finalstoragestringOptionalDefault: "temp"Artifact storage tier: temp (default, retained about 7 days) or persistent (long-term, billed by size). Insufficient balance or exceeding the storage cap silently downgrades to temp; the effective tier is shown in the task detail response.
temppersistentRequest examples
# Submit an async task; returns a taskId immediately (no waiting for generation)
curl -X POST "https://api.hiapi.sh/v1/tasks" \
-H "Authorization: Bearer $HIAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "hunyuan-image-3.0/instruct-edit",
"input": {
"prompt": "…",
"image_size": "square_hd",
"image_urls": "…",
"num_images": 1,
"output_format": "png",
"guidance_scale": 3.5,
"enable_prompt_expansion": true
}
}' const res = await fetch("https://api.hiapi.sh/v1/tasks", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.HIAPI_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "hunyuan-image-3.0/instruct-edit",
input: {
"prompt": "…",
"image_size": "square_hd",
"image_urls": "…",
"num_images": 1,
"output_format": "png",
"guidance_scale": 3.5,
"enable_prompt_expansion": true
}
}),
});
const task = await res.json();
// { code: 200, message: "success", data: { taskId } } import os, requests
res = requests.post(
"https://api.hiapi.sh/v1/tasks",
headers={"Authorization": f"Bearer {os.environ['HIAPI_API_KEY']}"},
json={
"model": "hunyuan-image-3.0/instruct-edit",
"input": {
"prompt": "…",
"image_size": "square_hd",
"image_urls": "…",
"num_images": 1,
"output_format": "png",
"guidance_scale": 3.5,
"enable_prompt_expansion": True
}
},
)
print(res.json()) # { code, message, data: { taskId } } 200 OK
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-01HZTQ8BX2N3GM3YFK4Z9D7VQR"
}
} 400 Bad Request
{
"code": 400,
"message": "invalid request",
"data": null,
"error_code": "INVALID_REQUEST"
} Get task detail
https://api.hiapi.sh/v1/tasks/:id Response fields
taskIdstringRequiredTask ID, always prefixed with tk-hiapi-.
modelstringRequiredResolved full model name. Tasks submitted with the route parameter return base@route (e.g. gpt-image-2/text-to-image@ext); otherwise identical to the name passed at creation.
routestringOptionalPresent only when the task was submitted with an explicit route parameter; echoes the submitted value.
statusstringRequiredTask status.
queued Queued, not started yet.
handling Being processed.
archiving Processing finished, artifacts being prepared.
success Terminal: completed, artifacts available (output returned).
fail Terminal: failed (error returned).
After submission, check status: success and fail are terminal, everything else is non-terminal. Poll every 1–3 seconds until terminal. On success, download artifacts from output[].url and transfer them before expireAt; pass storage: "persistent" at creation time when long-term retention is needed.
creatednumberRequiredTask creation time (Unix seconds).
completednumberRequiredUnix seconds when the task reached a terminal state; fixed to 0 while not terminal.
outputarrayOptional
Present only when status == success. Artifact list — always an array; a single task may return multiple types at once (e.g. video + first_frame).
Array [ object ]
Array items
urlstringRequiredArtifact URL, directly downloadable.
typestringRequiredCurrent possible values: video, image, audio, first_frame, last_frame, thumbnail; more may be added later.
expireAtnumberRequiredUnix seconds until which the artifact remains accessible; download or transfer before it expires.
errorobjectOptional
Present only when status == fail.
codestringRequiredBusiness error code.
messagestringRequiredError description.
Response examples
Success
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-01HZTQ8BX2N3GM3YFK4Z9D7VQR",
"model": "happyhorse-1-0",
"status": "success",
"created": 1777282033,
"completed": 1777282099,
"output": [
{
"url": "https://cdn.hiapi.ai/tasks/.../video.mp4",
"type": "video",
"expireAt": 1777886899
}
]
}
} Processing (non-terminal)
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-...",
"model": "happyhorse-1-0",
"status": "archiving",
"created": 1777282033,
"completed": 0
}
} Failed
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-...",
"model": "happyhorse-1-0",
"status": "fail",
"created": 1777282033,
"completed": 1777282099,
"error": {
"code": "TASK_FAILED",
"message": "task failed"
}
}
} Articles
View all articles →Related Models
View all models →Same Type
-
Seedream 5.0 ByteDance $0.025 /image -
GPT Image 2 OpenAI $0.007 /image -
FLUX.1 Kontext Max Black Forest Labs $0.071 /image -
Grok Imagine Image 2.0 xAI $0.052 /image -
FLUX.2 Klein 4B Black Forest Labs $0.0004 /image -
Kling Image 4.0 Kuaishou $0.081 /image -
Nano Banana 2 Lite Google $0.033 /image -
GPT Image 2.5 OpenAI $0.0021 /image -
Ideogram 4.6 Ideogram $0.011 /image -
FLUX 3 Image Black Forest Labs $0.041 /image -
Google Virtual Try-On Google $0.107 /image -
851 Labs Background Remover 851 Labs $0.002 /image