General Introduction
Flux Gym is an easy web UI for training FLUX LoRA with low graphics memory support (12GB/16GB/20GB). The front-end is based on AI-Toolkit's Gradio UI, and the back-end is powered by Kohya Scripts.Flux Gym combines the simplicity of the AI-Toolkit WebUI with the flexibility of Kohya Scripts for a wide range of graphics memory configurations, and supports Docker and automatic model download features.
Function List
- Supports 12GB, 16GB, 20GB video memory
- Docker support with automatic model download
- Support for customized base models
- Automatic generation of sample images
- Posted to Huggingface
- Advanced Function Options (hidden)
Using Help
Installation process
one-click installation
- utilizationPinokio one-click starterAutomatically installs and launches everything: Pinokio One-Click Launcher
manual installation
- Clone Fluxgym and kohya-ss/sd-scripts:
git clone https://github.com/cocktailpeanut/fluxgym cd fluxgym git clone -b sd3 https://github.com/kohya-ss/sd-scripts
- Activate the virtual environment:
- Windows.
python -m venv env env\Scripts\activate
- Linux.
python -m venv env source env/bin/activate
- Windows.
- Install the dependencies:
cd sd-scripts pip install -r requirements.txt cd . pip install --r requirements.txt pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
- Launch the application:
python app.py
Docker Installation
- Clone Fluxgym and kohya-ss/sd-scripts:
git clone https://github.com/cocktailpeanut/fluxgym cd fluxgym git clone -b sd3 https://github.com/kohya-ss/sd-scripts
- Build the image and run it:
docker compose up -d --build
- Open your browser and visit: http://localhost:7860
Functional operation flow
- Enter the LoRA information.
- Upload images and add tags (using trigger words).
- Click on the "Start" button.
Sample Image Configuration
By default, Fluxgym does not generate sample images during training. You can configure Fluxgym to generate sample images at every N steps:
- Sample Image Cues: These cues will be used to automatically generate images during training.
- Sample images per N steps: For example, if the "Expected training steps" is 960 and the "Sample images per N steps" is 100, the images will be generated at the 100th, 200th and 300th steps.
Advanced Sample Images
Using the built-in Kohya sd-scripts syntax, you have full control over the sample images generated during the training phase:
- Trigger words: e.g., hrld person.
- Advanced flags: e.g., the --d flag specifies the seed, --w specifies the image width, --h specifies the image height, etc.
Posted to Huggingface
- Get Huggingface Token:Huggingface Token
- Enter the Token and click "Login".
- Select the trained LoRA, edit the name and publish it to Huggingface.