Downloads · 30 days
0
dirga-roboticc/fluxgym
fluxgym is a machine learning model from dirga-roboticc. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Dead simple web UI for training FLUX LoRA with LOW VRAM (12GB/16GB/20GB) support.
Downloads · 30 days
0
Access
Public
Updated Oct 12, 2024
Repo size
10.4 GB
Likes
0
Public
Click a slice to open those files.
.safetensors10 GB · 96%
From the Hugging Face model README
Dead simple web UI for training FLUX LoRA with LOW VRAM (12GB/16GB/20GB) support.
FluxGym supports 100% of Kohya sd-scripts features through an Advanced tab, which is hidden by default.

Here are people using Fluxgym to locally train Lora sharing their experience:
https://pinokio.computer/item?uri=https://github.com/cocktailpeanut/fluxgym
To learn more, check out this X thread: https://x.com/cocktailpeanut/status/1832084951115972653
You can automatically install and launch everything locally with Pinokio 1-click launcher: https://pinokio.computer/item?uri=https://github.com/cocktailpeanut/fluxgym
First 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
Your folder structure will look like this:
/fluxgym
app.py
requirements.txt
/sd-scripts
Now activate a venv from the root fluxgym folder:
If you're on Windows:
python -m venv env
env\Scripts\activate
If your're on Linux:
python -m venv env
source env/bin/activate
This will create an env folder right below the fluxgym folder:
/fluxgym
app.py
requirements.txt
/sd-scripts
/env
Now go to the sd-scripts folder and install dependencies to the activated environment:
cd sd-scripts
pip install -r requirements.txt
Now come back to the root folder and install the app dependencies:
cd ..
pip install -r requirements.txt
Finally, install pytorch Nightly:
pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu121
Now let's download the model checkpoints.
First, download the following models under the models/clip foder:
Second, download the following model under the models/vae folder:
Finally, download the following model under the models/unet folder:
The result file structure will be something like:
/models
/clip
clip_l.safetensors
t5xxl_fp16.safetensors
/unet
flux1-dev.sft
/vae
ae.sft
/sd-scripts
/outputs
/env
app.py
requirements.txt
...
First 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
Now build the image and run it via docker-compose:
docker compose up -d --build
Open web browser and goto the IP address of the computer/VM: http://localhost:7860
Go back to the root fluxgym folder, with the venv activated, run:
python app.py
Make sure to have the venv activated before running
python app.py.Windows:
env/Scripts/activateLinux:source env/bin/activate
The usage is pretty straightforward:
That's all!

By default fluxgym doesn't generate any sample images during training.
You can however configure Fluxgym to automatically generate sample images for every N steps. Here's what it looks like:

To turn this on, just set the two fields:

Thanks to the built-in syntax from kohya/sd-scripts, you can control exactly how the sample images are generated during the training phase:
Let's say the trigger word is hrld person. Normally you would try sample prompts like:
hrld person is riding a bike
hrld person is a body builder
hrld person is a rock star
But for every prompt you can include advanced flags to fully control the image generation process. For example, the --d flag lets you specify the SEED.
Specifying a seed means every sample image will use that exact seed, which means you can literally see the LoRA evolve. Here's an example usage:
hrld person is riding a bike --d 42
hrld person is a body builder --d 42
hrld person is a rock star --d 42
Here's what it looks like in the UI:

And here are the results:

In addition to the --d flag, here are other flags you can use:
--n: Negative prompt up to the next option.--w: Specifies the width of the generated image.--h: Specifies the height of the generated image.--d: Specifies the seed of the generated image.--l: Specifies the CFG scale of the generated image.--s: Specifies the number of steps in the generation.The prompt weighting such as ( ) and [ ] also work. (Learn more about Attention/Emphasis)
HF_TOKEN (All local and private).
The advanced tab is automatically constructed by parsing the launch flags available to the latest version of kohya sd-scripts. This means Fluxgym is a full fledged UI for using the Kohya script.
By default the advanced tab is hidden. You can click the "advanced" accordion to expand it.
