ComfyUI > Nodes > comfyui_AcademiaSD > 💾 Save Dataset Caption (.txt)

ComfyUI Node: 💾 Save Dataset Caption (.txt)

Class Name

AcademiaSD_SaveCaption

Category
AcademiaSD/Dataset
Author
AcademiaSD (Account age: 683days)
Extension
comfyui_AcademiaSD
Latest Updated
2026-04-05
Github Stars
0.03K

How to Install comfyui_AcademiaSD

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

💾 Save Dataset Caption (.txt) Description

Saves image captions as .txt files for organized dataset management in AI projects.

💾 Save Dataset Caption (.txt):

The AcademiaSD_SaveCaption node is designed to facilitate the process of saving generated captions alongside their corresponding images in a dataset. This node is particularly useful for AI artists and developers who work with image datasets and need to maintain a structured and organized collection of captions. By automatically saving captions as .txt files next to the original images, this node streamlines the workflow, ensuring that all relevant textual information is easily accessible and properly associated with each image. The node's functionality is centered around the save_dataset_caption method, which handles the creation and storage of these caption files, providing a seamless integration into your dataset management process.

💾 Save Dataset Caption (.txt) Input Parameters:

generated_caption

This parameter represents the caption text that you want to save alongside the image. It is a required input and must be provided as a string. The generated caption is the main content that will be stored in the .txt file, and it should accurately describe or annotate the image it is associated with. There are no specific minimum or maximum values for this parameter, but it should be a meaningful and concise description of the image.

image_path

The image_path parameter specifies the file path to the image that the caption corresponds to. This is a required input and must be a valid string path pointing to an existing image file. The node uses this path to determine where to save the caption file, ensuring it is stored in the same directory as the image. It is crucial that this path is correct and points to an actual file, as an invalid path will result in an error.

extra_text

This optional parameter allows you to add additional text to the caption, which can serve as a prefix or suffix. The extra_text is a string that can be used to include keywords or trigger words that might be relevant for dataset categorization or searchability. By default, it is set to "trigger_word," but you can customize it to suit your needs. The extra text is trimmed of any leading or trailing whitespace before being used.

text_position

The text_position parameter determines where the extra_text will be placed in relation to the generated_caption. You can choose between "Start (Prefix)" or "End (Suffix)," with the default being "Start (Prefix)." This setting allows you to control the structure of the final caption text, ensuring that any additional information is positioned according to your preference.

separator

This parameter defines the string used to separate the generated_caption and extra_text when both are included in the final caption. The default separator is ", ", but you can customize it to any string that suits your formatting needs. The separator ensures that the caption and extra text are clearly delineated, enhancing readability and organization.

💾 Save Dataset Caption (.txt) Output Parameters:

final_saved_text

The final_saved_text output parameter provides the complete caption text that was saved to the .txt file. This string includes the generated_caption, any extra_text if specified, and the separator used to join them. The output is useful for verification purposes, allowing you to confirm that the caption was constructed and saved as intended. It reflects the exact content written to the file, ensuring transparency and traceability in your dataset management.

💾 Save Dataset Caption (.txt) Usage Tips:

  • Ensure that the image_path is correct and points to an existing image file to avoid errors during the saving process.
  • Customize the extra_text and separator to enhance the organization and searchability of your dataset captions, making them more informative and easier to categorize.
  • Use the text_position parameter to control the placement of additional information, ensuring that your captions are structured in a way that best suits your dataset's needs.

💾 Save Dataset Caption (.txt) Common Errors and Solutions:

Error: Ruta inválida: <image_path>

  • Explanation: This error occurs when the specified image_path does not point to a valid or existing file.
  • Solution: Double-check the image_path to ensure it is correct and that the file exists at the specified location. Correct any typos or path errors and try again.

Error escribiendo fichero: <error_message>

  • Explanation: This error indicates that there was an issue writing the caption to the .txt file, possibly due to file permissions or disk space issues.
  • Solution: Verify that you have write permissions for the directory where the image is located and that there is sufficient disk space. If the problem persists, check for any other system-level issues that might be preventing file writing.

💾 Save Dataset Caption (.txt) Related Nodes

Go back to the extension to check out more related nodes.
comfyui_AcademiaSD
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 Models, enabling artists to harness the latest AI tools to create incredible art.