← 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

FluxTrainSave

Node Documentation: FluxTrainSave

Overview

The FluxTrainSave node is part of the ComfyUI-FluxTrainer suite, designed to save the state and output of a training session conducted in the ComfyUI framework. This node is essential for users who utilize the FluxTrainer environment for training models and wish to save their progress, either in full or as LoRA models, for future use or deployment.

The ComfyUI-FluxTrainer simplifies the task of model training within the ComfyUI ecosystem by providing familiar interfaces and workflows. It uses kohya’s training scripts with some modifications to work seamlessly within ComfyUI, making it easier for users to train models without the need to switch environments or tools.

Functionality

  1. Saving Models: The FluxTrainSave node allows users to save the training state and checkpoint of a given model. This includes both the primary model components and any associated LoRA components.

  2. Copying Models: It provides an option to automatically copy the saved model to the appropriate folder within the ComfyUI environment, such as the LaRA folder.

Inputs

Required Inputs

  • network_trainer: This input accepts a NETWORKTRAINER object, representing the training session and its current state.

  • save_state: A boolean option that determines whether to save the entire model state, including all relevant parameters and configurations.

  • copy_to_comfy_lora_folder: A boolean option that specifies whether the saved LoRA model should be copied to the designated folder within ComfyUI for easier access and deployment.

Outputs

Returns

  • network_trainer: The updated network trainer object with the current state.

  • lora_path: A string indicating the path where the LoRA model has been saved or copied. This output is crucial for users to know the location of their model.

  • steps: An integer representing the number of steps completed in the training session up to the point of saving.

Usage in ComfyUI Workflows

The FluxTrainSave node is typically used at the end or at interim checkpoints during a training workflow in ComfyUI. It is integrated into workflows where users need to ensure their training results are preserved and can be easily retrieved for further training or inference tasks.

  1. Training Workflows: In a typical ComfyUI workflow that trains a machine learning model using the FluxTrainer environment, this node is added to commit the current state to disk. This is crucial for workflows that are computationally intensive and may not complete in a single session.

  2. LoRA Management: Users who frequently employ LoRA models can use this node at various stages of their training workflows to save these models separately. By leveraging the copy_to_comfy_lora_folder option, users can maintain an organized model repository within their ComfyUI setup.

Special Features or Considerations

  • Space Efficiency: When saving a model, the node ensures that only the necessary components are stored, allowing for efficient use of storage. Nevertheless, users need to ensure there is enough disk space available as training data can become extensive.

  • Portability: By copying the LoRA models directly into the ComfyUI directory structure, users can easily share or deploy these models. This is particularly useful for collaborative environments or for users needing to transfer models between different ComfyUI setups.

  • Checkpointing: The ability to save the entire state of the session allows for the resumption of training without loss of progress, a vital feature for complex models or those trained over long periods.

The FluxTrainSave node thus plays a key role in managing training outputs in the ComfyUI-FluxTrainer environment, ensuring that models are saved accurately and readily available for future use.