ComfyUI > Nodes > ComfyUI_FL-Trainer > FL Kohya Data Loader

ComfyUI Node: FL Kohya Data Loader

Class Name

FL_LoadImagesFromDirectoryPath

Category
🏵️Fill Nodes/Training
Author
filliptm (Account age: 1765days)
Extension
ComfyUI_FL-Trainer
Latest Updated
2024-07-23
Github Stars
0.06K

How to Install ComfyUI_FL-Trainer

Install this extension via the ComfyUI Manager by searching for ComfyUI_FL-Trainer
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI_FL-Trainer 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
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

FL Kohya Data Loader Description

Automates loading images and captions from directory for AI dataset preparation.

FL Kohya Data Loader:

The FL_LoadImagesFromDirectoryPath node is designed to streamline the process of loading images and their corresponding captions from a specified directory. This node is particularly useful for AI artists who need to manage large datasets of images and captions for training purposes. By automating the retrieval and pairing of images with their captions, it significantly reduces the manual effort involved in dataset preparation. The node reads image files in common formats such as PNG, JPG, WEBP, and JPEG, and pairs them with caption files that have a specified extension. This ensures that each image is correctly associated with its descriptive text, facilitating more effective training and data management.

FL Kohya Data Loader Input Parameters:

directory

The directory parameter specifies the path to the folder containing the images and captions you want to load. This should be a string representing the full path to the directory. The node will search this directory for image files and their corresponding caption files. If the directory does not exist, the node will return empty lists for both images and captions. The default value is "X://path/to/images".

caption_extension

The caption_extension parameter defines the file extension of the caption files associated with the images. This should be a string and can be either .caption or .txt. The node will look for caption files with this extension that match the base name of each image file. For example, if an image file is named image1.png, the node will look for a caption file named image1.txt if the extension is set to .txt. The default value is .txt.

FL Kohya Data Loader Output Parameters:

images

The images output parameter is a list of image tensors that have been loaded from the specified directory. Each image is converted from its original format to a tensor, which is a data structure commonly used in machine learning for storing multi-dimensional data. These tensors can then be used directly in training models or other processing tasks.

captions

The captions output parameter is a list of strings, where each string is the content of a caption file associated with an image. These captions provide descriptive text that can be used for training models to understand and generate text based on image content. The captions are read from files with the specified extension and are paired with their corresponding images.

FL Kohya Data Loader Usage Tips:

  • Ensure that the directory path you provide is correct and accessible to avoid errors related to missing files.
  • Use consistent naming conventions for your image and caption files to ensure they are correctly paired by the node.
  • Verify that the caption files have the correct extension as specified in the caption_extension parameter to ensure they are loaded properly.

FL Kohya Data Loader Common Errors and Solutions:

Directory does not exist

  • Explanation: The specified directory path does not exist or is incorrect.
  • Solution: Double-check the directory path and ensure it is correct and accessible.

Caption file not found

  • Explanation: The node could not find a caption file with the specified extension for an image.
  • Solution: Ensure that all images have corresponding caption files with the correct extension and that the naming conventions match.

Unsupported image format

  • Explanation: The node encountered an image file with an unsupported format.
  • Solution: Ensure that all image files are in one of the supported formats: PNG, JPG, WEBP, or JPEG.

FL Kohya Data Loader Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI_FL-Trainer
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.