Visit ComfyUI Online for ready-to-use ComfyUI environment
Automates translation of text in CSV files for multilingual datasets, specifying source/target languages, rows, and columns.
The AD_CSVTranslator
node is designed to facilitate the translation of text within CSV files, making it an invaluable tool for AI artists and other users who need to work with multilingual datasets. This node automates the process of translating text from one language to another within specified columns of a CSV file, leveraging online translation services to ensure accuracy and efficiency. By allowing users to specify source and target languages, as well as which rows and columns to translate, the AD_CSVTranslator
provides a flexible and user-friendly solution for managing multilingual content. This node is particularly beneficial for those looking to localize content or analyze data across different languages, as it streamlines the translation process and integrates seamlessly into workflows that involve CSV data manipulation.
The csv_path
parameter specifies the file path to the CSV file that you wish to translate. It is crucial for locating the file on your system, and the node will return an error if the file is not found at the specified path. The default value is an empty string, indicating that you need to provide a valid path for the node to function.
The source_column
parameter indicates the column number in the CSV file from which the text will be translated. It is an integer value with a default of 1, and it must be between 1 and 1000. This parameter determines which column's text will be used as the source for translation.
The target_column
parameter specifies the column number where the translated text will be placed. Like source_column
, it is an integer with a default of 2, and it must also be between 1 and 1000. This parameter allows you to choose where the translated text will be stored in the CSV file.
The source_lang
parameter defines the language of the text in the source column. It can be set to "auto" for automatic detection, or you can specify "en" for English or "zh-CN" for Chinese. This parameter is essential for ensuring the translation service correctly interprets the source text.
The target_lang
parameter sets the language into which the text will be translated. You can choose between "zh-CN" for Chinese and "en" for English. This parameter is critical for directing the translation service to produce the desired output language.
The translate_first_row
parameter is a boolean that determines whether the first row of the CSV file should be translated. By default, it is set to False
, meaning the first row, often containing headers, will not be translated unless specified otherwise.
The seed
parameter is an integer used to initialize the random number generator, which can affect the selection of rows for translation if randomness is involved. It has a default value of 0 and can range from 0 to 0xffffffffffffffff. This parameter ensures reproducibility in scenarios where random selection is used.
The updated_csv_path
output parameter returns the file path of the CSV file after the translation process is complete. This indicates where the translated CSV file is saved, allowing you to access and use the updated file.
The seed
output parameter returns the seed value used during the translation process. This is useful for tracking and reproducing the translation results, especially if randomization was involved in the process.
csv_path
is correctly specified and points to an existing CSV file to avoid file not found errors.translate_first_row
parameter wisely, especially if your CSV file contains headers in the first row that should not be translated.source_lang
to "auto" if you are unsure of the source language, allowing the translation service to automatically detect it.seed
parameter for reproducibility if you are using any random selection processes within your workflow.<csv_path>
csv_path
to ensure it is correct and that the file exists at the specified location.<error_message>
RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Playground, enabling artists to harness the latest AI tools to create incredible art.