ComfyUI Extension: ComfyUI-TranslationNode
Offline translation node for ComfyUI, powered by Facebook's M2M-100 multilingual model. Translate text between 100+ languages β completely offline and private.
Custom Nodes (0)
README
π― ComfyUI Translation Node (Offline)
Offline translation node for ComfyUI, powered by Facebook's M2M-100 multilingual model. Translate text between 100+ languages β completely offline and private.
π Features
- π Translate between 100+ languages
- π§ Automatic source language detection
- β‘ Works entirely offline once the model is downloaded
- π§© Seamless integration with text/image/video workflows in ComfyUI
- πΎ Cached model for faster reuse
π οΈ Installation
- Copy or clone this repository into your ComfyUI custom nodes folder:
ComfyUI/custom_nodes/ComfyUI-TranslationNode/
- Install dependencies:
pip install -r requirements.txt
- Prepare the model files (see the next section).
- Restart ComfyUI and look for π― Translation Node (Offline) under the Text category.
π§± Local Model Setup
This node uses Facebookβs M2M-100 (418M) multilingual translation model.
- Download the model manually from Hugging Face: π https://huggingface.co/facebook/m2m100_418M
- Create the following folder structure inside your ComfyUI installation:
ComfyUI/ βββ custom_nodes/ β βββ ComfyUI-TranslationNode/ βββ models/ βββ translation/ βββ facebook/ βββ m2m100_418M/
- Place all downloaded files into that final folder (m2m100_418M/):pytorch_model.bin rust_model.ot config.json source.spm target.spm tokenizer_config.json special_tokens_map.json
- When you launch ComfyUI, you should see this in the console:
[TranslationNode] Using local model: models/translation/facebook/m2m100_418M
β Once the model is in place, the node will never download anything β it will always load from your local drive.
π‘ Usage
- Add the Translation Node to your workflow.
- Enter any text you want to translate.
- Choose a target language (default: en).
- The source language can be set to autofor automatic detection.
- Connect the output (translated_text) to other nodes β for example, to an image generation prompt.
- Enjoy entering prompts in your own language β the node will handle the translation automatically!
π§ Model Details
- Model: facebook/m2m100_418M
- Type: Multilingual encoder-decoder transformer
- Languages supported: 100+
- Size on disk: ~3.6 GB (pytorch_model.bin ~1.8 GB, rust_model.ot ~1.8 GB)
- Framework: PyTorch via Hugging Face Transformers
π Privacy & Security
This node runs entirely offline.
- π§© All translations are processed locally on your computer.
- πΎ The model is loaded from ComfyUI/models/translation/facebook/m2m100_418M.
- π« No text, metadata, or user data is ever sent to external servers or APIs.
- π Safe to use with confidential or private content.
- π Once installed, you can use it without any internet connection.
βοΈ Requirements
transformers>=4.41.0
sentencepiece
torch
langdetect
π€ Author
Petr ProvaznΓk β 2025
π License
MIT License Β© 2025
Created for the ComfyUI community.