← See All Custom Node Packs

ComfyUI-FluxTrainer

1150

Run ComfyUI Easily with InstaSD

Skip the complex setup. InstaSD helps creative professionals build workflows and deploy them to the world:

  • One-click deployment
  • Any model, any node
  • Powerful GPUs for rapid iteration
Get Started

FluxTrainModelSelect

FluxTrainModelSelect Node Documentation

Overview

The FluxTrainModelSelect node is a part of the ComfyUI FluxTrainer repository. It is designed to facilitate the selection and loading of models required for training using the FluxTrainer within the ComfyUI environment. This node helps users specify essential components including transformer models, VAE, CLIP, and T5 embeddings, which are essential for advanced training workflows such as LoRA training.

Purpose

The primary purpose of the FluxTrainModelSelect node is to consolidate paths to various model components into a single entity. This simplifies the process of initializing training workflows by ensuring all the necessary models are efficiently loaded and organized for use in the FluxTrainer framework.

Inputs

The node accepts the following inputs:

  1. Transformer (Required)

    • Type: Predefined list
    • Description: Specifies the filename of the transformer model (commonly a UNet model) necessary for training.
  2. VAE (Required)

    • Type: Predefined list
    • Description: Specifies the filename of the Variational Autoencoder (VAE) model, which is crucial for image encoding and decoding within training processes.
  3. CLIP (Required)

    • Type: Predefined list
    • Description: Specifies the filename of the CLIP model for interpreting and embedding text prompts.
  4. T5 (Required)

    • Type: Predefined list
    • Description: Specifies the filename of the T5 model, another essential component for text processing in training workflows.
  5. LoRA Path (Optional)

    • Type: String
    • Defaults: An empty string
    • Description: If provided, specifies a path to a pre-trained LoRA model. This can be incorporated into the training as a starting point for further tuning.

Outputs

The node produces the following output:

  1. Flux Models
    • Type: A specific structured model container (TRAIN_FLUX_MODELS)
    • Description: An organized collection of paths to the specified transformer, VAE, CLIP, and T5 models. This container is intended for easy integration into subsequent nodes within training workflows.

Usage in ComfyUI Workflows

This node plays a vital role in training workflows within ComfyUI, especially when using the FluxTrainer for model training. Users can integrate the FluxTrainModelSelect node into their workflows as the initial step to systematically load all necessary models. The consolidated output can then be passed to other nodes like training initialization nodes, optimizer configuration nodes, and training loops, enabling a smooth training setup.

Example Workflow:

  1. Node 1: FluxTrainModelSelect
    Begin by using the FluxTrainModelSelect node to select and load paths for the necessary models.

  2. Node 2: InitFluxLoRATraining
    Use the output from FluxTrainModelSelect as input for initializing LoRA training workflows.

  3. Node 3: FluxTrainLoop/FluxTrainAndValidateLoop
    Continue by integrating with a training loop to iteratively train based on the selected models.

  4. Node 4: FluxTrainSave
    Conclude by saving the trained models using the FluxTrainSave node, capturing the outcomes of the training session.

Special Features and Considerations

  • Model Flexibility: By allowing users to specify models for key components (transformer, VAE, CLIP, T5), the node supports a wide range of training configurations and setups.
  • Optional Pre-trained LoRA Integration: The optional lora_path input accommodates the workflow's starting from pre-trained checkpoints, offering a foundation for advanced fine-tuning.
  • Seamless Workflow Integration: With a single output, the node efficiently handles the paths of all model components, promoting ease of connection and integration into subsequent nodes in the workflow.
  • User-Friendly Design: Encourages adoption by providing a familiar UI experience if you are already a ComfyUI user, and reduces the potential for errors stemming from manual path management.

This node is essential for users looking to streamline their model training setup within the ComfyUI environment, particularly when leveraging the extensive capabilities of the ComfyUI FluxTrainer repository.