ComfyUI > Nodes > ComfyUI > Load Image and Text Dataset from Folder

ComfyUI Node: Load Image and Text Dataset from Folder

Class Name

LoadImageTextDataSetFromFolder

Category
dataset
Author
ComfyAnonymous (Account age: 763days)
Extension
ComfyUI
Latest Updated
2026-05-13
Github Stars
112.77K

How to Install ComfyUI

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

Load Image and Text Dataset from Folder Description

Streamline loading image-text datasets from folder for AI tasks, automating retrieval of images and captions.

Load Image and Text Dataset from Folder:

The LoadImageTextDataSetFromFolder node is designed to streamline the process of loading image datasets along with their corresponding text annotations from a specified folder. This node is particularly beneficial for AI artists and developers who work with image-text datasets, as it automates the retrieval of images and their associated captions, ensuring a seamless integration into your workflow. By leveraging this node, you can efficiently manage and utilize datasets that follow a structured format, where each image is paired with a text file containing its description or annotation. This capability is essential for tasks such as training machine learning models, where image-text pairs are required. The node simplifies the dataset preparation process, allowing you to focus on creative and analytical tasks rather than manual data handling.

Load Image and Text Dataset from Folder Input Parameters:

folder

The folder parameter specifies the directory from which the node will load images and their corresponding text annotations. This parameter is crucial as it determines the source of your dataset. The folder should contain images in supported formats such as .png, .jpg, .jpeg, and .webp, along with text files that share the same base name as the images but with a .txt extension. The node will recursively search through subdirectories, supporting complex folder structures often used in dataset organization. There are no explicit minimum or maximum values for this parameter, but it should be a valid directory path accessible by the system.

Load Image and Text Dataset from Folder Output Parameters:

images

The images output parameter provides a list of images loaded from the specified folder. This output is essential for further processing or analysis within your workflow, as it delivers the visual data component of your dataset. Each image in the list corresponds to a file found in the input directory, ensuring that all relevant visual data is captured and ready for use.

captions

The captions output parameter delivers a list of text annotations associated with the images. Each caption corresponds to an image in the images output, providing the descriptive or contextual information necessary for tasks that require image-text pairing. This output is crucial for applications such as training AI models that rely on understanding the relationship between visual and textual data.

Load Image and Text Dataset from Folder Usage Tips:

  • Ensure that your folder structure is organized with images and their corresponding text files sharing the same base name to facilitate accurate loading of image-text pairs.
  • Utilize this node in conjunction with other nodes that process or analyze image-text data to create a comprehensive workflow for tasks such as model training or dataset exploration.

Load Image and Text Dataset from Folder Common Errors and Solutions:

"Folder not found"

  • Explanation: This error occurs when the specified folder path does not exist or is inaccessible.
  • Solution: Verify that the folder path is correct and that the directory is accessible by the system. Ensure that you have the necessary permissions to read from the directory.

"No valid images found"

  • Explanation: This error indicates that the folder does not contain any images with supported file extensions.
  • Solution: Check that the folder contains images in supported formats such as .png, .jpg, .jpeg, or .webp. Ensure that the images are not corrupted and are readable by the system.

"Missing text files for images"

  • Explanation: This error suggests that some images do not have corresponding text files with the same base name.
  • Solution: Ensure that each image in the folder has a corresponding text file with the same base name but a .txt extension. This pairing is necessary for the node to load image-text datasets correctly.

Load Image and Text Dataset from Folder Related Nodes

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

Load Image and Text Dataset from Folder