ComfyUI > Nodes > DJZ-Nodes > Captions To Prompt List

ComfyUI Node: Captions To Prompt List

Class Name

CaptionsToPromptList

Category
custom/text
Author
DriftJohnson (Account age: 4052days)
Extension
DJZ-Nodes
Latest Updated
2025-04-25
Github Stars
0.04K

How to Install DJZ-Nodes

Install this extension via the ComfyUI Manager by searching for DJZ-Nodes
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter DJZ-Nodes 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

Captions To Prompt List Description

Converts multiple text file captions into a consolidated prompt list for AI artists working with large datasets.

Captions To Prompt List:

The CaptionsToPromptList node is designed to streamline the process of converting multiple text files containing captions into a single, consolidated prompt list. This node is particularly useful for AI artists who work with large datasets of textual descriptions and need to compile these into a unified format for further processing or analysis. By traversing a specified directory, the node reads all .txt files, extracts their content, and combines the captions into a single string, which can then be used as a comprehensive prompt list. This functionality is beneficial for organizing and managing large volumes of text data, ensuring that all relevant captions are easily accessible in one place. The node also generates an output filename based on the directory name, making it easy to identify and manage the resulting prompt list.

Captions To Prompt List Input Parameters:

directory_path

The directory_path parameter specifies the path to the directory containing the caption files you wish to process. This parameter is crucial as it directs the node to the location where it should search for .txt files to read and compile. The default value is set to "/path/to/dataset", but you should replace this with the actual path to your dataset. This parameter does not have a minimum or maximum value, but it must be a valid directory path on your system.

reload

The reload parameter is a boolean option that determines whether the node should reprocess the files based on changes. If set to True, the node will check for any changes in the files and reprocess them if necessary. This is useful for ensuring that the prompt list is always up-to-date with the latest captions. The default value is False, meaning the node will only reprocess if the directory path changes. This parameter helps optimize performance by avoiding unnecessary reprocessing.

Captions To Prompt List Output Parameters:

combined_captions

The combined_captions output is a single string that contains all the captions from the processed text files, joined together with newline characters. This output is essential for creating a comprehensive prompt list that can be used for various purposes, such as training AI models or generating creative content. The combined string ensures that all captions are easily accessible and organized in one place.

output_filename

The output_filename output provides the name of the file where the combined captions are saved. This filename is derived from the name of the directory being processed, appended with .txt. This output is useful for identifying and managing the resulting prompt list file, making it easy to locate and use in subsequent tasks.

Captions To Prompt List Usage Tips:

  • Ensure that the directory_path is correctly set to the location of your caption files to avoid processing errors.
  • Use the reload parameter to control when the node should reprocess files, which can help optimize performance by avoiding unnecessary operations.
  • Regularly check the output filename to ensure it matches your expectations and is correctly derived from the directory name.

Captions To Prompt List Common Errors and Solutions:

Error processing <file_path>: <error_message>

  • Explanation: This error occurs when the node encounters an issue while trying to read a specific file. The <error_message> provides details about the nature of the problem, such as file access permissions or encoding issues.
  • Solution: Verify that the file exists at the specified path and that you have the necessary permissions to read it. Ensure that the file is not corrupted and is encoded in UTF-8 format.

Ignoring file <filename>

  • Explanation: This message indicates that a file in the directory does not have a .txt extension and is therefore ignored by the node.
  • Solution: Ensure that all files you want to process have a .txt extension. If there are other file types in the directory, consider moving them to a different location to avoid confusion.

Captions To Prompt List Related Nodes

Go back to the extension to check out more related nodes.
DJZ-Nodes
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.