Qwen-MT-Image accurately translates text in images while preserving the original layout. The model also supports domain hints, sensitive word filtering, and terminology intervention.
Model overview
Source language: English |
Japanese |
|---|---|
Portuguese |
Arabic |
Model | Description | Available regions | Output image specifications |
|---|---|---|---|
qwen-mt-image-2.0 | An image translation model that translates text in images across 55 languages while accurately preserving original layout and content. Supports terminology definitions, sensitive word filtering, and product subject detection. Provides flexible, accurate, and efficient image localization services. | China (Beijing) Singapore | Image format: JPG |
qwen-mt-image | Qwen image translation model. Supports translation between Chinese or English and other languages. Direct translation between two non-Chinese, non-English languages (e.g., Japanese to Korean) is not supported. See Supported languages. | China (Beijing) | Image format: JPG |
Prerequisites
Obtain an API key and export the API key as an environment variable.
Synchronous call
POST https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/services/aigc/image2image/image-synthesis. Replace {WorkspaceId} with your actual Workspace ID.
In synchronous mode, the request waits for processing to complete and returns the translated image URL directly, without polling task status.
Request parametersRequest headersContent-Typestring (Required)The content type of the request. Must be application/json.Authorization string (Required)Authenticates the request with a Model Studio API key. Example: Bearer sk-xxxx.Request bodymodelstring (Required)Model name. Set to qwen-mt-image-2.0 or qwen-mt-image.input object (Required)An input parameter object containing the following fields:
Properties image_url string (Required)Publicly accessible image URL (HTTP or HTTPS).
string (Required)The source language.
string (Required)The target language.
object (Optional)Optional extended fields.
Properties domainHint string (Optional)A domain hint to adapt translation style for a specific domain. Use English to describe the scenario, style, and requirements (max 200 words for quality).Example: These sentences are from seller-buyer conversations on a B2C ecommerce platform. Translate them into clear, engaging customer service language, ensuring the translation is appropriate for handling potential issues or disputes.sensitives array (Optional)Sensitive words to filter from image text before translation. The filter performs an exact match (case-sensitive).Sensitive words can be in any supported source or target language (max 50 per request for quality).Example: ["10% off entire store", "7-day no-questions-asked return"]terminologies array (Optional)Use terminology intervention to set specific translations for domain-specific terms. Term pair languages must match source_lang and target_lang.
Properties src string (Required)The source text of the term. The language must be the same as source_lang.tgtstring (Required)The target text of the term. The language must be the same as target_lang.object (Optional)
Properties imageSegment bool (Optional)When enabled, image subject segmentation excludes text on image subjects (people, products, logos) from translation.
Note: The parameter was previously named |
|
Response parametersoutputobjectOutput information.
Properties image_url stringURL of the generated image (same dimensions as source, JPG format). Valid for 24 hours. Download and save promptly.objectUsage statistics. Counted only for successful results.
Properties image_count integerNumber of images generated (always 1).stringUnique request identifier for tracing and troubleshooting.code stringError code. Returned only for failed requests. See Error codes.message stringDetailed error message. Returned only for failed requests. See Error codes. |
|
Asynchronous call
POST https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/services/aigc/image2image/image-synthesis. Replace {WorkspaceId} with your actual Workspace ID.
The asynchronous call has two steps:
- Create a task and obtain a task ID: Send a request to create a task. The request returns a task ID (task_id).
- Query the result using the task ID: Poll the task status with the task_id until completion and retrieve the image URL.
Step 1: Create a task and get a task ID
- After creating a task, use the returned
task_idto query the result. The task_id is valid for 24 hours. Poll for results instead of creating duplicate tasks. - For a tutorial, see Postman.
Request parametersRequest headersContent-Typestring (Required)The content type of the request. Must be application/json.Authorization string (Required)Authenticates the request with a Model Studio API key. Example: Bearer sk-xxxx.X-DashScope-Async string (Required)Enables asynchronous processing. Must be enable.Request bodymodelstring (Required)Model name. Set to qwen-mt-image-2.0 or qwen-mt-image.input object (Required)An input parameter object containing the following fields:
Properties image_url string (Required)Publicly accessible image URL (HTTP or HTTPS).
string (Required)The source language.
string (Required)The target language.
object (Optional)Optional extended fields.
Properties domainHint string (Optional)A domain hint to adapt translation style for a specific domain. Use English to describe the scenario, style, and requirements (max 200 words for quality).Example: These sentences are from seller-buyer conversations on a B2C ecommerce platform. Translate them into clear, engaging customer service language, ensuring the translation is appropriate for handling potential issues or disputes.sensitives array (Optional)Sensitive words to filter from image text before translation. The filter performs an exact match (case-sensitive).Sensitive words can be in any supported source or target language (max 50 per request for quality).Example: ["10% off entire store", "7-day no-questions-asked return"]terminologies array (Optional)Use terminology intervention to set specific translations for domain-specific terms. Term pair languages must match source_lang and target_lang.
Properties src string (Required)The source text of the term. The language must be the same as source_lang.tgtstring (Required)The target text of the term. The language must be the same as target_lang.object (Optional)
Properties imageSegment bool (Optional)When enabled, image subject segmentation excludes text on image subjects (people, products, logos) from translation.
Note: The parameter was previously named |
|
Response parametersoutputobjectTask output information.
Properties task_id stringThe task ID. Valid for queries for 24 hours.task_status stringThe status of the task.
Enumeration values
stringUnique request identifier for tracing and troubleshooting.message stringDetailed error message. Returned only for failed requests. See Error codes.code stringError code. Returned only for failed requests. See Error codes. |
Save the task_id to query the task status and result. |
Step 2: Query the result using the task ID
GET https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/tasks/{task_id}
- The
task_idis valid for 24 hours. Nonexistent or expired IDs return statusUNKNOWN. - The
urlfor successful tasks is valid for 24 hours. Download and save promptly. - The default RPS for this query API is 1. For more frequent queries or event notifications, configure an asynchronous task callback.
- To query or cancel tasks in batches, see Manage asynchronous tasks.
Request parametersRequest headersAuthorizationstring (Required)Authenticates the request with a Model Studio API key. Example: Bearer sk-xxxx.URL path parameterstask_idstring (Required)The ID of the task. |
Replace 86ecf553-d340-4e21-xxxxxxxxx with the actual task_id. |
Response parametersoutputobjectInformation about the task output.
Properties task_id stringThe task ID. Valid for queries for 24 hours.task_status stringThe status of the task.
Enumeration values
stringThe time when the task was submitted. Format: YYYY-MM-DD HH:mm:ss.SSS.scheduled_time stringThe time when the task was executed. Format: YYYY-MM-DD HH:mm:ss.SSS.end_time stringThe time when the task was completed. Format: YYYY-MM-DD HH:mm:ss.SSS.image_url stringThe URL of the model-generated image (same dimensions as the source, JPG format, valid for 24 hours). Download and save promptly.code stringError code. Returned only for failed requests. See Error codes.messagestringDetailed information about the request failure. For more information, see Error messages.Usually not returned for successful requests. Returned only when the image contains no translatable text (e.g., after subject segmentation). The task still succeeds and is billed normally, returning No text detected for translation.objectUsage statistics. These are counted only for successful tasks.
Properties image_count integerNumber of images generated (always 1).stringUnique request identifier for tracing and troubleshooting. |
Task data (task status and image URLs) is retained for only 24 hours and then automatically purged. Save generated images promptly. |
Supported languages
Set source_lang to auto for automatic language detection.
Languages supported by qwen-mt-image-2.0
qwen-mt-image-2.0 supports translation between any combination of the 55 languages listed below, without requiring Chinese or English as source or target. All languages can be used as both source and target.
| Language | Code |
|---|---|
| Simplified Chinese | zh |
| Traditional Chinese | zh-tw |
| English | en |
| Japanese | ja |
| Korean | ko |
| German | de |
| Spanish | es |
| Russian | ru |
| French | fr |
| Portuguese | pt |
| Italian | it |
| Vietnamese | vi |
| Indonesian | id |
| Malay | ms |
| Thai | th |
| Arabic | ar |
| Dutch | nl |
| Polish | pl |
| Turkish | tr |
| Ukrainian | uk |
| Greek | el |
| Hungarian | hu |
| Romanian | ro |
| Czech | cs |
| Swedish | sv |
| Danish | da |
| Finnish | fi |
| Norwegian | no |
| Hindi | hi |
| Tamil | ta |
| Telugu | te |
| Nepali | ne |
| Persian | fa |
| Azerbaijani | az |
| Kazakh | kk |
| Uzbek | uz |
| Mongolian | mn |
| Uyghur | ug |
| Belarusian | be |
| Bulgarian | bg |
| Serbian | sr |
| Croatian | hr |
| Bosnian | bs |
| Slovenian | sl |
| Slovak | sk |
| Macedonian | mk |
| Latvian | lv |
| Lithuanian | lt |
| Irish | ga |
| Luxembourgish | lb |
| Afrikaans | af |
| Latin | la |
| Chechen | ce |
| Ingush | inh |
| Mari | chm |
Languages supported by qwen-mt-image
qwen-mt-image requires at least one of the source or target languages to be Chinese or English. Direct translation between other language pairs (e.g., Japanese to Korean) is not supported.
| Language | Code | As source language | As target language |
|---|---|---|---|
| Chinese | zh | Supported | Supported |
| English | en | Supported | Supported |
| Korean | ko | Supported | Supported |
| Japanese | ja | Supported | Supported |
| Russian | ru | Supported | Supported |
| Spanish | es | Supported | Supported |
| French | fr | Supported | Supported |
| Portuguese | pt | Supported | Supported |
| Italian | it | Supported | Supported |
| German | de | Supported | Not supported |
| Vietnamese | vi | Supported | Supported |
| Malay | ms | Not supported | Supported |
| Thai | th | Not supported | Supported |
| Indonesian | id | Not supported | Supported |
| Arabic | ar | Not supported | Supported |
Billing and rate limits
- For free quota and pricing, see Model pricing.
- For rate limits, see Rate limits.
- Billing is per successfully generated image. Failed calls and errors incur no fees.
- If an image contains no translatable text (or no text outside subject areas after segmentation), the task still succeeds and is billed normally, returning
No text detected for translation.
Error codes
If the model call fails and returns an error message, see Error codes for resolution.
FAQ
Q: Why is content in the image not translated?
The subject segmentation feature excludes text on image subjects (people, products, logos) from translation. To translate all text in the image, set ext.config.imageSegment to false.
Q: How do I convert a temporary image link to a permanent one?
Temporary links cannot be converted directly to permanent ones. Download the image via a backend service and upload it to OSS to get a permanent link.
Example code: Download an image to your local machine
Example code: Download an image to your local machine



