FluxGym: Low-VRAM Training GUI for flux lora

Posted on September 9, 2024 - General

Ever wanted to train FLUX LoRAs but got stuck because of high VRAM requirements? Say hello to Flux Gym.

UI

fluxgym-ui.png

What's Flux Gym All About?

Flux Gym is a no-nonsense web UI for training FLUX LoRA models. The best part? It works with lower VRAM setups - we're talking 12GB, 16GB, and 20GB.

Here's the deal:

  • It's built on the AI-Toolkit project (shoutout to @multimodalart for the slick Gradio UI)
  • Under the hood, it's powered by Kohya Scripts for the actual training

Why Flux Gym?

Look, I get it. Training FLUX LoRAs can be a pain:

  • AI-Toolkit is great, but it needs 24GB VRAM. Ouch.
  • Kohya Scripts are flexible, but command line? Not everyone's cup of tea.

Key Features

  • Works with 12GB, 16GB, and 20GB VRAM setups
  • Dead simple web interface
  • Powered by Kohya Scripts (so it's expandable)

Getting Started

The Easy Way: One-Click Install

  1. Head over to Pinokio: https://pinokio.computer/item?uri=https://github.com/cocktailpeanut/fluxgym
  2. Click, wait, done. It'll set everything up locally.

The DIY Way: Manual Install

  1. Clone the repos:

    git clone https://github.com/cocktailpeanut/fluxgym
    cd fluxgym
    git clone -b sd3 https://github.com/kohya-ss/sd-scripts
    
  2. Set up a virtual environment:

    • Windows:
      python -m venv env
      env\Scripts\activate
      
    • Linux:
      python -m venv env
      source env/bin/activate
      
  3. Install dependencies:

    cd sd-scripts
    pip install -r requirements.txt
    cd ..
    pip install -r requirements.txt
    
  4. Get PyTorch Nightly:

    pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu121
    
  5. Download model checkpoints (check the original instructions for links)

  6. Fire it up:

    python app.py
    

How to Use Flux Gym

It's straightforward:

  1. Enter your LoRA info
  2. Upload images and add captions (use that trigger word)
  3. Hit "start"

That's it. Seriously.

FAQ

Q: Do I need coding skills to use Flux Gym? A: Nope. The web UI makes it point-and-click easy.

Q: Can I use this on a laptop GPU? A: If you've got 12GB VRAM or more, you're good to go.

Q: How does this compare to other FLUX LoRA training tools? A: It's simpler to use but still packs the power of Kohya Scripts.

The Bottom Line

FluxGym bridges the gap between ease-of-use and low VRAM requirements for FLUX LoRA training. It's not fancy, it's not complicated - it just works.

Want to dive deeper? Check out the full thread: https://x.com/cocktailpeanut/status/1832084951115972653

Give it a shot. Your GPU will thank you.

Citations: https://github.com/cocktailpeanut/fluxgym