A powerful OOMOL package for translating text in images using the Qwen Multi-modal Translation API. This package provides both URL-based and file-based workflows to seamlessly integrate image translation into your processing pipelines.
- Translate text in images via URL
- Translate text in local image files
- Support for 9 languages (Chinese, English, Korean, Japanese, Russian, Spanish, French, Portuguese, Italian)
- Automatic cloud upload and download
- Configurable polling for translation completion
- Easy-to-use subflow blocks
This package includes two main subflows for different use cases:
Translate text in an image URL from source to target language and return the translated image URL.
Inputs:
imageURL(string, required): The URL of the image to be translatedsourceLang(string, required): Source language code (default: "en")- Options: zh, en, ko, ja, ru, es, fr, pt, it
targetLang(string, required): Target language code (default: "zh")- Options: zh, en, ko, ja, ru, es, fr, pt, it
Outputs:
translatedImageURL(string): URL of the translated image
Use Case: Perfect for processing web-hosted images or when you want to keep images in the cloud.
Translate text in a local image file from source to target language and save the result.
Inputs:
image_file(file, required): Local image file to translatesourceLang(string, required): Source language code (default: "en")targetLang(string, required): Target language code (default: "zh")saved_path(string, optional): Path to save the translated image
Outputs:
saved_path(string): Path of the successfully downloaded translated image
Use Case: Ideal for batch processing local images or integrating translation into file-based workflows.
The package supports translation between the following languages:
| Language | Code |
|---|---|
| Chinese (简体中文) | zh |
| English (英文) | en |
| Korean (韩语) | ko |
| Japanese (日语) | ja |
| Russian (俄语) | ru |
| Spanish (西班牙语) | es |
| French (法语) | fr |
| Portuguese (葡萄牙语) | pt |
| Italian (意大利语) | it |
- Add the
url-image-translationsubflow to your workflow - Connect an image URL to the
imageURLinput - Select source and target languages
- The translated image URL will be available in the
translatedImageURLoutput
- Add the
local-image-translationsubflow to your workflow - Select a local image file using the
image_fileinput - Choose source and target languages
- Optionally specify where to save the result in
saved_path - The translated image will be saved and its path returned in the output
This package includes two core task blocks:
Submit an image translation request to the Qwen MT Image service and receive a task ID for result polling.
Inputs:
imageURL(string): The URL of the image to be translatedsourceLang(string): Source language codetargetLang(string): Target language code
Outputs:
taskId(string): Task ID for polling the translation result
Poll the Qwen MT Image service for translation results using the task ID. Automatically retries until the task is complete or max retries is reached.
Inputs:
taskId(string): The task ID from submit requestmaxRetries(number, optional): Maximum polling attempts (default: 60)retryInterval(number, optional): Seconds between polls (default: 2)
Outputs:
translatedImageURL(string): URL of the translated imagestatus(string): Final status of the translation
This package requires the following OOMOL packages:
upload-to-cloud(v0.0.5): For uploading local files to cloud storagedownloader(v0.1.1): For downloading translated images
This package can be installed through the OOMOL package manager:
# Install the package
oomol install qwen-mt-image
# Add to your workspace dependencies
oomol use qwen-mt-imageThe translation service uses the OOMOL Fusion API. No additional API key configuration is required - the package automatically uses your OOMOL token for authentication.
Both subflows follow a similar pattern:
- Submit Phase: Submit the image (URL or uploaded file) to the Qwen MT API
- Poll Phase: Continuously check the translation status until completion
- Retrieve Phase: Return or download the translated image
The polling system includes:
- Configurable retry attempts to handle long translation times
- Adjustable retry intervals to balance responsiveness and API load
- Automatic error handling and status reporting
- Default configuration: 60 retries with 2-second intervals (up to 2 minutes)
The package integrates with the Qwen Multi-modal Translation API through OOMOL's Fusion API endpoint:
- Base URL:
https://fusion-api.oomol.com/v1 - Authentication: Automatic via OOMOL token
- Endpoints:
/image/translationfor submission and result retrieval
- Image Analysis: The AI analyzes the image to detect and extract text
- Text Translation: Detected text is translated from source to target language
- Image Rendering: The translated text is rendered back onto the image maintaining original layout and styling
The package includes robust error handling:
- Connection failures are reported with clear error messages
- Timeout scenarios are handled gracefully with retry logic
- Translation status is tracked and reported throughout the process
- Invalid language codes are validated before submission
- E-commerce: Translate product images for international markets
- Documentation: Localize technical diagrams and screenshots
- Social Media: Adapt visual content for different regions
- Marketing: Convert promotional materials for global campaigns
- Education: Translate instructional materials and infographics
Current version: 0.0.1
This package is provided as part of the OOMOL ecosystem.