Super Easy Guide to Train FLUX LoRA with FluxGym

Taehyeong LeeTaehyeong Lee
3 min read

Introduction to FluxGym

  • FluxGym is an open-source Web UI that helps create LoRA, a partial fine-tuning piece of the FLUX base model. It allows users to quickly and intuitively generate desired LoRA without knowing the complex background configuration and ecosystem. (FluxGym is currently the easiest tool in the FLUX ecosystem for creating LoRA in a local environment.)
  • This post summarizes how to install FluxGym and create LoRA from your image dataset.

Understanding LoRA (Low-Rank Adaptation)

  • LoRA is a fine-tuning technique that allows you to customize the base model without training the entire network
  • It creates a small, specialized "add-on" that teaches the model new styles or subjects
  • Significantly reduces training time and resource requirements compared to full model fine-tuning
  • Perfect for creating personalized image generators while maintaining the base model's capabilities

Why FluxGym?

  • Simplifies the complex LoRA training process into an intuitive web interface
  • Eliminates the need for command-line operations or coding knowledge
  • Optimized specifically for the FLUX model ecosystem
  • Includes smart defaults that work well for most use cases
  • Supports automatic caption generation using Florence-2

Requirements

  • Machine: Windows 11 + GPU with VRAM 12GB MIN (Actual testing shows it works smoothly even with 10GB VRAM.)

  • Package Manager: Pinokio

  • Package: FluxGym

  • Model: FLUX.1 [dev]

  • VAE: ae.sft

  • Text Encoder: clip_l.safetensors, t5xxl_fp16.safetensors

Installing Pinokio

  • Pinokio is a container tool for AI open source. Similar to Docker in the software world, it creates an isolated virtual environment within the local environment, simplifying the complex dependencies between libraries in the background. Download and install the appropriate file for your operating system from this link.

Installing FluxGym

  • FluxGym allows super easy image training to create LoRA through a 3-step intuitive UI. Download and install the appropriate file for your operating system from this link.

Running FluxGym

  • All preparations for LoRA training are complete. Launch FluxGym following these steps:
Launch Pinokio
→ [FluxGym]

Training LoRA

  • Once the web interface launches in your browser, apply the following settings for optimal LoRA generation:
# Step 1. LoRA Info
→ The name of your LoRA: {your-lora-name}
→ Trigger word/sentence: {your-trigger-word}
→ Base model: [flux-dev]
→ VRAM: [12G] (default 24GB)
→ Repeat trains per image: 5 (default 10)
→ Max Train Epochs: 8 (default 16)

# Advanced options
→ --save_every_n_epochs: 2

# Step 2. Dataset
→ Upload your images: (Select and drag-and-drop at least 20 images for training)
→ [Add AI captions with Florence-2] (Automatically generate image captions)

# Step 3. Train
→ [Start training]
  • The most important aspect is the image dataset. Select and upload 20-30 images on the same subject with various angles and environments, preferably in equal proportions.

  • Based on the above setup, starting the training with a 20-image dataset takes about 8 hours on an RTX 3080 (VRAM 10GB). Therefore, it's recommended to start the process before going to bed.

  • Once the training is complete, the LoRA is generated as a {your-lora-name}.safetensors file in the pinokio\api\fluxgym.git\outputs directory. If you're using Stable Diffusion WebUI Forge, copy this file to the Data/Models/Lora directory to be ready for use.

1
Subscribe to my newsletter

Read articles from Taehyeong Lee directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Taehyeong Lee
Taehyeong Lee