ComfyUI > Nodes > ComfyUI-Addoor > 🌻 CSV Translator

ComfyUI Node: 🌻 CSV Translator

Class Name

AD_CSVTranslator

Category
🌻 Addoor/CSV
Author
ADDOOR (Account age: 2884days)
Extension
ComfyUI-Addoor
Latest Updated
2025-01-24
Github Stars
0.03K

How to Install ComfyUI-Addoor

Install this extension via the ComfyUI Manager by searching for ComfyUI-Addoor
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-Addoor in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

🌻 CSV Translator Description

Automates translation of text in CSV files for multilingual datasets, specifying source/target languages, rows, and columns.

🌻 CSV Translator:

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.

🌻 CSV Translator Input Parameters:

csv_path

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.

source_column

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.

target_column

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.

source_lang

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.

target_lang

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.

translate_first_row

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.

seed

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.

🌻 CSV Translator Output Parameters:

updated_csv_path

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.

seed

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 Translator Usage Tips:

  • Ensure that the csv_path is correctly specified and points to an existing CSV file to avoid file not found errors.
  • Use the translate_first_row parameter wisely, especially if your CSV file contains headers in the first row that should not be translated.
  • Set the source_lang to "auto" if you are unsure of the source language, allowing the translation service to automatically detect it.
  • Consider the seed parameter for reproducibility if you are using any random selection processes within your workflow.

🌻 CSV Translator Common Errors and Solutions:

Error: CSV file not found at <csv_path>

  • Explanation: This error occurs when the specified CSV file path does not exist or is incorrect.
  • Solution: Double-check the csv_path to ensure it is correct and that the file exists at the specified location.

Error processing CSV: <error_message>

  • Explanation: This error indicates that an exception occurred during the CSV processing, which could be due to various reasons such as file access issues or incorrect CSV structure.
  • Solution: Verify that the CSV file is accessible and properly formatted. Ensure that the specified columns exist and that the file is not open in another program.

🌻 CSV Translator Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-Addoor
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

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.