**Introduction:**
- [ComfyUI_Custom_Nodes_AlekPet Repository](https://github.com/AlekPet/ComfyUI_Custom_Nodes_AlekPet)
- **Stars:** 1300
- **Author:** AlekPet
The Google Translate Text Node is a custom node for ComfyUI that allows you to translate text from one language to another using Google Translate. This node is part of the AlekPet Nodes suite, which extends the capabilities of ComfyUI with various custom functionalities. It leverages the `googletrans` library for translation, offering a seamless way to integrate translation directly into your ComfyUI workflows.
**Google Translate Text Node Input:**
The Google Translate Text Node accepts the following inputs:
- `from_translate`: A dropdown menu allowing you to select the source language for the translation. It includes an "auto" option for automatic language detection, as well as a comprehensive list of languages supported by Google Translate.
- `to_translate`: A dropdown menu to select the target language for the translation. It includes a comprehensive list of languages supported by Google Translate.
- `manual_translate`: A boolean value. If set to `True`, the node will bypass translation and simply pass the input `text` through. This is useful if you want to conditionally translate text.
- `text`: A multiline string field where you input the text you want to translate.
- `clip`: This input is available in `GoogleTranslateCLIPTextEncodeNode` and accepts a CLIP model. This is used to tokenize and encode the translated text into conditioning information for use in other nodes.
**Google Translate Text Node Output:**
The Google Translate Text Node produces the following outputs:
- `text`: A string containing the translated text.
- `CONDITIONING`: (Only available in `GoogleTranslateCLIPTextEncodeNode`) Conditioning information generated from the translated text, suitable for use in other ComfyUI nodes that require conditioning inputs.
**Google Translate Text Node Usage Tips:**
1. **Automatic Language Detection:** Set the `from_translate` input to "auto" to let Google Translate automatically detect the source language.
2. **Conditional Translation:** Use the `manual_translate` boolean input to toggle translation on or off. This is useful for workflows where you might want to use the original text sometimes and translated text other times.
3. **API Key:** The node can use either the `googletrans` library directly or the Google Translation API if you have an API key set in the environment variable `GOOGLE_TRANSLATION_API_KEY`. Using an API key can provide more reliable and potentially faster translations.
4. **Combining with CLIP Text Encode:** The `GoogleTranslateCLIPTextEncodeNode` version of the node directly integrates with CLIP text encoding, allowing you to translate text and immediately use it for generating images or other conditioning tasks.
5. **Language Support:** Ensure that both the source and target languages are supported by Google Translate. The node provides a comprehensive list of available languages in the dropdown menus.
6. **No Translation:** If you want to use node for other text manipulations, you can set `manual_translate` to `True`.

GoogleTranslateTextNode