ComfyUI Extension: ComfyUI-Translator
ComfyUI plug-in collection of basic translator, LLM translator and a series of LLM Service Connectors.
Custom Nodes (0)
README
ComfyUI Translator Nodes
ComfyUI plug-in collection of basic translator, LLM translator and a series of LLM Service Connectors.
Node List
1. Basic Translator
Supports traditional machine translation services: Google/Baidu/Youdao/Tencent
2. LLM Translator
High-quality translation powered by Large Language Models, works with:
- Load LLM Model - Load local LLM models
- General LLM Service Connector - OpenAI-compatible API gateway connector (private gateway support)
- Dedicated Service Connectors - Provider-specific connectors:
- SiliconFlow Service Connector
- ZhiPu Service Connector
- DeepSeek Service Connector
- Kimi Service Connector
- Gemini Service Connector
- ChatGPT Service Connector
- Ollama LLM Connector - Call models via Ollama
Features
Basic Translator
- Multiple Translation Services: Google Translate, Baidu Translate, Youdao Translate, Tencent Translate
- Text Input: Supports multi-line text input, manual input or upstream node connection
- Target Language Selection: Dropdown menu with 10 common languages
- API Key Configuration: Optional API key input for domestic services
- Error Handling: Comprehensive exception handling
LLM Translator
- Multiple Providers: 9 mainstream LLM providers including OpenAI, Claude, DeepSeek, Qwen, Grok
- Local Model Support: Load locally deployed large language models
- Ollama Integration: Call local or remote models via Ollama
- Flexible Configuration: Customizable system prompts and model parameters
Supported Languages
- English
- Chinese (中文)
- Japanese (日本語)
- Korean (한국어)
- French (Français)
- German (Deutsch)
- Spanish (Español)
- Italian (Italiano)
- Russian (Русский)
- Portuguese (Português)
Installation
Method 1: Manual Installation
- Copy the entire folder to ComfyUI's
custom_nodesdirectory. - Install dependencies:
pip install -r requirements.txt - Restart ComfyUI.
Method 2: Git Clone
- Navigate to ComfyUI's
custom_nodesdirectory. - Clone the repository:
git clone https://github.com/OwlvChirotha/ComfyUI-Translator.git - Install dependencies:
pip install -r ComfyUI-Translator/requirements.txt - Restart ComfyUI.
Method 3: ComfyUI Manager
- Open ComfyUI Manager and search for
ComfyUI-Translator. - Install the plugin through the Manager interface.
- Restart ComfyUI to load the newly installed nodes.
Usage
Basic Translator Guide
- Find "Text Processing" category in ComfyUI node menu
- Add "Basic Translator" node to workflow
- Input text to translate (manual or from upstream node)
- Select target language
- Choose translation service
- Execute workflow to get translation result
Translation Service Configuration
Google Translate
- Environment: International network
- Requirements: No configuration needed
- Note: Requires proxy in mainland China
Baidu Translate (Recommended for China)
- Environment: Mainland China network
- Free Quota: 2 million characters/month
- Apply: https://fanyi-api.baidu.com/
- Setup:
- Register Baidu account and login
- Create application to get App ID and Secret Key
- Fill in
baidu_app_idandbaidu_secret_keyin node
Youdao Translate (Recommended for China)
- Environment: Mainland China network
- Free Quota: Daily free API calls
- Apply: https://ai.youdao.com/
- Setup:
- Register Youdao AI Cloud account
- Create application to get App ID and Secret
- Fill in
youdao_app_idandyoudao_secret_keyin node
LLM Translator Guide
Method 1: Cloud LLM Services
Option A: General LLM Service Connector (for private gateways & OpenAI-compatible APIs)
- Add "General LLM Service Connector" node
- Enter API endpoint URL (default: https://api.openai.com/v1/chat/completions)
- For private gateways: http://your-gateway-url/v1/chat/completions
- For vLLM: http://localhost:8000/v1/chat/completions
- For any OpenAI-compatible service
- Fill in API key (password protected)
- Select model from dropdown or enter custom model name
- Connect to "LLM Translator" node
Use Cases:
- Private/internal LLM deployments (vLLM, FastChat, Text Generation WebUI)
- Enterprise API gateways
- OpenAI-compatible proxy services
- Custom LLM endpoints
Option B: Dedicated Service Connectors (provider-specific, recommended)
- Add specific connector node:
- ChatGPT Service Connector - OpenAI GPT models (gpt-4o, gpt-4o-mini, gpt-4-turbo, o1, etc.)
- DeepSeek Service Connector - DeepSeek models (deepseek-chat, deepseek-v3, deepseek-r1, etc.)
- Kimi Service Connector - Moonshot Kimi models (moonshot-v1-8k/32k/128k, kimi-v1)
- ZhiPu Service Connector - Zhipu GLM models (glm-4, glm-4v, glm-3-turbo)
- Gemini Service Connector - Google Gemini models (gemini-1.5-pro/flash, gemini-2.0-flash-exp)
- SiliconFlow Service Connector - Multiple models via SiliconFlow API
- Select model from provider-specific dropdown
- (Optional) Enter custom model ID for unlisted models
- Fill in API key (password protected)
- Connect to "LLM Translator" node
- Input text and target language
- Execute translation
Benefits of Dedicated Connectors:
- Only shows models supported by selected provider
- Easier model selection without confusion
- Clearer workflow organization
Method 2: Local Models
- Add "Load LLM Model" node
- Select model source:
- ComfyUI models/LLM directory
- Custom directory (absolute path)
- Connect to "LLM Translator" node
- Execute translation
Method 3: Ollama
- Add "Ollama LLM Connector" node
- Configure Ollama host (default http://localhost:11434)
- Specify model name (e.g., llama3:8b, qwen2:7b)
- Connect to "LLM Translator" node
- Execute translation
Technical Implementation
Basic Translator
- Google Translate: Uses googletrans library, free but requires international network
- Baidu Translate: Official API, MD5 signature authentication
- Youdao Translate: Official API, SHA256 signature authentication
- Auto Language Detection, comprehensive error handling
LLM Translator
- Unified Interface: Supports 9 mainstream LLM providers
- Real API Calls: Integrated with official APIs
- Local Model Support: Reserved interface for local model loading
- Ollama Integration: Supports local/remote Ollama calls
Notes
Network Environment
- Mainland China Users: For Basic Translator, use Baidu/Youdao; for LLM, use DeepSeek/Qwen or other domestic services
- International Users: Can use Google Translate and OpenAI/Claude or other international services
- Stable network connection required
API Configuration
- API keys are password-protected in UI (not displayed in plain text)
- Clear API keys before sharing workflows to avoid leakage
- Keep API keys secure
Usage Limits
- Each translation service has rate limits and quotas
- May require payment after free quota is exhausted
- Use responsibly, avoid frequent calls
License
This project is licensed under the GNU General Public License v3.0 (GPL-3.0).
- You may use, modify, and redistribute this project under the terms of the GPL-3.0.
- Any derivative works must also be distributed under the GPL-3.0.
- A full copy of the license is provided in the
LICENSEfile or at https://www.gnu.org/licenses/gpl-3.0.en.html.