✨Prompt Translate:
PromptTranslate is a versatile node designed to facilitate the translation of text prompts from one language to another, making it an invaluable tool for AI artists who work with multilingual content. This node automatically detects the input language and translates it into the desired target language, supporting a variety of translation services. By leveraging different translation models, including popular services like Baidu, PromptTranslate ensures that your text is accurately translated, maintaining the original context and meaning. This node is particularly beneficial for artists looking to expand their creative reach across different linguistic audiences, as it simplifies the process of translating prompts without requiring extensive technical knowledge.
✨Prompt Translate Input Parameters:
source_text
This parameter represents the text that you wish to translate. It is a required input and can be entered as a string. The text can be multiline, allowing you to input longer prompts or paragraphs. The default value is an empty string, and you can use the placeholder "Input text to translate..." to guide your input. This parameter is crucial as it directly affects the translation output, and entering a trigger word [R] can ensure the node executes every time.
target_language
This parameter allows you to select the language into which you want to translate the source text. The available options are "English" and "Chinese," with "English" set as the default. Choosing the correct target language is essential for achieving the desired translation results, as it determines the language of the output text.
translate_service
This parameter lets you choose the translation service and model to be used for the translation process. The options are dynamically retrieved and include hardcoded services like Baidu Translate. The default service is the first option available, or "Baidu Translate" if no options are retrieved. Selecting the appropriate service can impact the quality and accuracy of the translation, as different services may have varying strengths in handling specific languages or contexts.
ollama_auto_unload
This boolean parameter controls whether the Ollama model is automatically unloaded after the translation generation. It is enabled by default, meaning the model will be unloaded to free up resources once the translation is complete. This setting is useful for optimizing system performance, especially when working with large models or limited VRAM.
✨Prompt Translate Output Parameters:
translated_text
This output parameter provides the translated version of the input text. It is returned as a string and represents the final result of the translation process. The translated text is crucial for users who need to understand or utilize the content in a different language, ensuring that the original message is conveyed accurately and effectively.
✨Prompt Translate Usage Tips:
- Ensure that the
source_textis clear and free of errors to improve the accuracy of the translation. Using simple and direct language can help achieve better results. - Select the appropriate
translate_servicebased on the language pair and context of your text. Some services may perform better with specific languages or types of content.
✨Prompt Translate Common Errors and Solutions:
Invalid service selection: <translate_service>
- Explanation: This error occurs when the selected translation service is not recognized or supported by the node.
- Solution: Verify that the
translate_serviceparameter is set to a valid option from the available list. If the issue persists, check for updates or changes in the service options.
API returned empty result
- Explanation: This error indicates that the translation service did not return any translated text, possibly due to an issue with the input or service.
- Solution: Double-check the
source_textfor any errors or unsupported characters. If the problem continues, try using a different translation service or model.
Service config not found: <translate_service>
- Explanation: This error suggests that the configuration for the selected translation service is missing or not properly set up.
- Solution: Ensure that the service configuration is correctly installed and accessible. Consult the documentation or support resources for assistance in setting up the service.
