ComfyUI > Nodes > ComfyUI-Addoor > 🌻 CSV Reader

ComfyUI Node: 🌻 CSV Reader

Class Name

AD_CSVReader

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 Reader Description

Facilitates reading and processing of CSV files in ComfyUI, offering flexible data extraction and selection methods.

🌻 CSV Reader:

The AD_CSVReader node is designed to facilitate the reading and processing of CSV files within the ComfyUI environment. This node allows you to extract data from CSV files, either by selecting specific columns or by processing the entire content. It offers flexibility in data selection through both random and sequential methods, making it a versatile tool for handling structured data. By leveraging a seed for randomization and an increment for sequential access, the node provides a robust mechanism for data retrieval, which can be particularly useful in scenarios where you need to iterate over data or select random samples. The node's primary goal is to simplify the interaction with CSV files, enabling you to focus on data manipulation and analysis without worrying about the underlying file handling complexities.

🌻 CSV Reader Input Parameters:

file_path

The file_path parameter specifies the location of the CSV file you wish to read. It is a string input that should contain the full path to the file. This parameter is crucial as it directs the node to the correct file for processing. The default value is an empty string, and it does not support multiline input.

column_index

The column_index parameter determines which column of the CSV file to process. It is an integer value where 0 indicates that all columns should be used. If you specify a positive integer, the node will process only that specific column. The minimum value is 0, and the maximum is 1000, with a default of 0.

seed

The seed parameter is an integer used to initialize the random number generator for selecting a random line from the CSV file. This ensures that the random selection is reproducible. The minimum value is 0, and the maximum is 0xffffffffffffffff, with a default of 0.

increment

The increment parameter is an integer that defines the step size for sequential line selection. A value of 0 triggers random selection, while any other value will select lines sequentially based on the current index. The range is from -1000 to 1000, with a default of 1.

index

The index parameter is an optional integer that specifies the starting row for processing. It allows you to begin reading from a specific line, with 0 or 1 representing the first row. The minimum value is 0, and the maximum is 0xffffffffffffffff. This parameter is forced to be input by the user and comes with a tooltip for guidance.

🌻 CSV Reader Output Parameters:

File_Path

The File_Path output returns the path of the CSV file that was processed. This is useful for verification and logging purposes.

Seed

The Seed output provides the seed value used for random selection, allowing you to track the randomization process and ensure reproducibility.

Increment

The Increment output returns the increment value used for sequential selection, which helps in understanding the step size used during data processing.

Full_Content

The Full_Content output contains the entire processed content of the CSV file as a single string. This is useful for scenarios where you need to analyze or display the complete data set.

Lines

The Lines output is a list of strings representing the processed lines from the CSV file. This allows for easy iteration and manipulation of individual data entries.

Total_Lines

The Total_Lines output provides the total number of lines in the CSV file, offering insight into the size of the data set being processed.

Selected_Line

The Selected_Line output returns the specific line that was selected based on the seed and increment parameters. This is particularly useful for tasks that require sampling or specific data retrieval.

🌻 CSV Reader Usage Tips:

  • Ensure the file_path is correctly specified to avoid file not found errors.
  • Use the column_index to focus on specific data columns, which can optimize processing time and resource usage.
  • Set the seed to a fixed value for consistent random selections across different runs.
  • Adjust the increment to control the flow of data processing, especially when iterating over large data sets.
  • Utilize the index parameter to start processing from a specific row, which can be helpful for resuming tasks or skipping headers.

🌻 CSV Reader Common Errors and Solutions:

Error: Invalid column index <column_index>

  • Explanation: This error occurs when the specified column index is out of range, either negative or exceeding the number of columns in the CSV file.
  • Solution: Verify the column index to ensure it is within the valid range of the CSV file's columns.

Error reading CSV file: <error_message>

  • Explanation: This error indicates a problem encountered while attempting to read the CSV file, such as file not found or permission issues.
  • Solution: Check the file_path for accuracy, ensure the file exists, and verify that you have the necessary permissions to access it.

🌻 CSV Reader 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.