ComfyUI > Nodes > ComfyUI > Shuffle Image-Text Dataset

ComfyUI Node: Shuffle Image-Text Dataset

Class Name

ShuffleImageTextDataset

Category
dataset/image
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

Shuffle Image-Text Dataset Description

ShuffleImageTextDataset shuffles images and text descriptions while maintaining their relationships for varied training datasets in machine learning.

Shuffle Image-Text Dataset:

The ShuffleImageTextDataset node is designed to shuffle images and their corresponding text descriptions together, ensuring that the relationship between each image and its text is maintained. This node is particularly useful in scenarios where you want to randomize the order of your dataset while preserving the pairing of images and texts. By shuffling both elements simultaneously, it helps in creating varied training datasets for machine learning models, which can improve the robustness and generalization of the models. The node leverages a random seed to ensure reproducibility, allowing you to achieve consistent shuffling results across different runs if desired.

Shuffle Image-Text Dataset Input Parameters:

images

This parameter accepts a list of images that you want to shuffle. The images are shuffled in conjunction with their corresponding text descriptions, ensuring that the pairing remains intact. There is no explicit minimum or maximum value for the number of images, but the list should be non-empty to perform shuffling.

texts

This parameter takes a list of text descriptions corresponding to the images. Each text in the list should match the image at the same index, maintaining the relationship between the two. Like the images, the list of texts should be non-empty and of the same length as the images list to ensure proper shuffling.

seed

The seed parameter is an integer value used to initialize the random number generator for shuffling. It ensures that the shuffling process is reproducible. The default value is 0, and it can range from 0 to 18,446,744,073,709,551,615 (0xFFFFFFFFFFFFFFFF). By setting a specific seed, you can achieve the same shuffling order across different executions, which is useful for debugging or consistent dataset preparation.

Shuffle Image-Text Dataset Output Parameters:

images

This output provides the shuffled list of images. The order of images is randomized based on the seed provided, but each image remains paired with its corresponding text description. This output is crucial for tasks that require varied input data sequences, such as training machine learning models.

texts

This output delivers the shuffled list of text descriptions. The texts are shuffled in the same order as the images, ensuring that each text remains correctly paired with its corresponding image. This output is essential for maintaining the integrity of the dataset when the order is randomized.

Shuffle Image-Text Dataset Usage Tips:

  • To ensure reproducibility of your shuffling process, always set a specific seed value. This allows you to achieve the same shuffled order across different runs.
  • Make sure that the lists of images and texts are of the same length to avoid errors and ensure that each image has a corresponding text description.

Shuffle Image-Text Dataset Common Errors and Solutions:

ValueError: Number of texts does not match number of images.

  • Explanation: This error occurs when the number of text descriptions does not match the number of images provided.
  • Solution: Ensure that the lists of images and texts are of the same length before passing them to the node. Each image should have a corresponding text description.

IndexError: List index out of range

  • Explanation: This error might occur if the lists of images and texts are not properly aligned or if one of the lists is empty.
  • Solution: Verify that both lists are non-empty and have the same number of elements. Double-check the input data to ensure proper alignment.

Shuffle Image-Text Dataset 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.

Shuffle Image-Text Dataset