FluxGym FLUX LoRA Training: Colab, RunPod, Hidden Settings
Guide to FluxGym FLUX LoRA training on Colab and RunPod — including the hidden Kohya settings every trainer should know.
On this page
- TL;DR
- What Is FluxGym and Why Does It Matter for Low-VRAM Training?
- FluxGym on Google Colab: Free FLUX LoRA Training with T4 GPUs
- The T5 Attention Mask Trap
- RunPod: Faster Training on Paid GPUs
- What Kohya sd-scripts Actually Recommends for FLUX.1 Training
- FluxGym's Other Hidden Features
- Common Errors and Fixes
- FAQ
- Sources
FluxGym FLUX LoRA Training Guide: Colab, RunPod, and Hidden Settings
TL;DR
- FluxGym is free and runs on GPUs with 12 GB VRAM or less. Its Kohya sd-scripts backend offloads transformer blocks to CPU RAM via
--blocks_to_swap, letting you train on hardware AI-Toolkit cannot touch. - Google Colab's T4 GPU (16 GB) works but is slow. FluxGym on Colab is a free entry point — expect training to take longer than on RunPod, where faster GPUs cut the wait significantly.
- FluxGym hides every advanced Kohya setting behind a collapsed tab. The defaults work for quick tests, but critical parameters like
--guidance_scale,--timestep_sampling, and--model_prediction_typelive in the Advanced section and must be set manually for best results.
What Is FluxGym and Why Does It Matter for Low-VRAM Training?
FluxGym is an open-source web UI for training FLUX LoRA models without a terminal. Its Gradio frontend is forked from AI-Toolkit, which only supports GPUs with 24 GB VRAM or more, while the backend uses Kohya's sd-scripts, which implements CPU-GPU block swapping to dramatically lower VRAM requirements. The result is a tool supporting GPUs with 12 GB to 20 GB VRAM — something AI-Toolkit cannot do. For users without expensive hardware, FluxGym bridges that gap by exposing Kohya's block-swapping feature through a point-and-click interface. See also our full FluxGym FLUX LoRA training guide for more.
FluxGym on Google Colab: Free FLUX LoRA Training with T4 GPUs
Google Colab provides free access to NVIDIA T4 GPUs with 16 GB VRAM. A community member created a FluxGym Colab notebook that runs the full FluxGym UI directly in a browser — no local installation required.
How to set up FluxGym on Colab
- Open the Colab notebook linked above.
- Run all cells to install FluxGym and its dependencies (PyTorch nightly, Kohya sd-scripts from the
sd3branch). - Wait for the Gradio interface to launch — a public URL appears in the output.
- Upload your training images, write captions using a trigger word, and click Start.
The notebook also offers a RunPod template as a paid, faster alternative.
What FluxGym hides from Colab users
The default Colab experience exposes only the basic fields: LoRA name, image directory, caption prefix, and training steps. Critical FLUX-specific settings that determine output quality are buried in the Advanced tab, which is collapsed by default. The FluxGym docs confirm that this tab is "automatically constructed by parsing the launch flags available to the latest version of kohya sd-scripts" — meaning every Kohya feature is accessible, but only if you know to expand it (FluxGym README).
The most consequential hidden settings include:
| Setting | Default value (in Kohya) | Recommended value for FLUX.1 | What it does | Source |
|---|---|---|---|---|
--guidance_scale | 3.5 | 1.0 | Disables classifier-free guidance for training (FLUX.1 dev is distilled with CFG baked in) | Kohya docs |
--timestep_sampling | sigma | flux_shift | Shifts timestep distribution based on resolution, matching FLUX.1 dev inference | Kohya docs |
--model_prediction_type | sigma_scaled | raw | Uses raw model predictions without sigma scaling | Kohya docs |
--blocks_to_swap | 0 (none) | 16–22 depending on VRAM | Offloads transformer blocks to CPU RAM | Kohya docs |
--apply_t5_attn_mask | Off | Off for FLUX (required for Chroma) | Applies attention masks to T5-XXL text encoder | Kohya docs |
Running with defaults on a T4 GPU means the training script uses --guidance_scale 3.5 (the inference value) and --model_prediction_type sigma_scaled, both of which the Kohya documentation explicitly recommends changing for FLUX.1 training. The guidance scale default is particularly important: the Kohya docs state it "default is 3.5, so be sure to specify this" at 1.0 for FLUX.1 dev (source).
The T5 Attention Mask Trap
For every VRAM tier, see GPU VRAM settings for Flux LoRA training.
FLUX.1 is a large transformer model. Kohya's official documentation provides a VRAM-per-tier reference for flux_train_network.py. All recommendations below assume --fp8_base is enabled:
| GPU VRAM | Required settings | Notes |
|---|---|---|
| 24 GB | Basic settings, batch size 2 | No block swapping needed |
| 16 GB | Batch size 1 + --blocks_to_swap | Colab T4 falls here |
| 12 GB | --blocks_to_swap 16 + AdamW8bit | |
| 10 GB | --blocks_to_swap 22 + fp8 T5XXL checkpoint | Community reports significant slowdown vs higher-VRAM tiers |
| 8 GB | --blocks_to_swap 28 + fp8 T5XXL checkpoint | Maximum practical low-VRAM tier |
Source: Kohya sd-scripts FLUX training docs
The --blocks_to_swap mechanism moves FLUX.1's transformer block weights between GPU VRAM and CPU RAM. FLUX.1 supports up to 35 blocks for swapping. Higher block counts reduce VRAM usage but increase CPU-GPU transfer overhead, slowing training proportionally. For GPUs below 10 GB, the Kohya docs also recommend an fp8-format T5-XXL checkpoint.
Note that --fp8_base reduces VRAM usage but the Kohya documentation warns that "training results may vary" — it trades precision for memory savings.
RunPod: Faster Training on Paid GPUs
RunPod provides cloud GPUs at per-second billing. A community-built FluxGym RunPod template pre-installs FluxGym and its dependencies, eliminating manual setup.
RunPod pricing for common FLUX training GPUs
| GPU | VRAM | Price/hr | Best for |
|---|---|---|---|
| A40 | 48 GB | $0.44 | Budget FLUX.1 dev training, batch size 2 |
| L40S | 48 GB | $0.99 | Faster training, same VRAM tier |
| A100 PCIe | 80 GB | $1.39 | Large batch sizes, minimal swapping |
| A100 SXM | 80 GB | $1.49 | Fastest A100 option |
Source: RunPod pricing page
On a 48 GB GPU like the A40 or L40S, you can train FLUX.1 with batch size 2 and no block swapping — the simplest possible configuration. This eliminates the speed penalty that makes Colab training slow.
Common RunPod mistakes
For more details on the RunPod workflow and configuration, see our RunPod FLUX LoRA training guide.
Two issues recur in community reports. First, RunPod's web interface may load indefinitely if an antivirus program (notably Avast) blocks its API calls — temporarily disabling the antivirus resolves this. Second, the training UI on RunPod requires paths that begin with a forward slash (e.g., /workplace/your-dataset); omitting it causes training to fail silently. Users must also manually save settings before relaunching training, or changes are discarded (community reports).
What Kohya sd-scripts Actually Recommends for FLUX.1 Training
Beside the Advanced tab in FluxGym, Kohya's own documentation specifies these baseline training parameters for FLUX.1:
--network_dim=16 --network_alpha=1
--learning_rate=1e-4
--optimizer_type="AdamW8bit"
--lr_scheduler="constant"
--mixed_precision="fp16"
--gradient_checkpointing
--sdpa
--guidance_scale=1.0
--timestep_sampling="flux_shift"
--model_prediction_type="raw"
Source: Kohya FLUX training docs
The documentation also provides a verified recommended combination: --timestep_sampling shift --discrete_flow_shift 3.1582 --model_prediction_type raw --guidance_scale 1.0. For Chroma models, use --timestep_sampling sigmoid and --guidance_scale 0.0 instead.
Training steps: what the community reports
Community experience suggests that 3,000 steps often produces better results than 4,000 for FLUX LoRA, as higher step counts can lead to overbaked outputs. Stylized models have reportedly been achieved in as few as 1,000 steps. These are community-reported figures from individual trainers, not controlled benchmarks [Civitai 7431].
FluxGym's Other Hidden Features
Beyond the Advanced tab, FluxGym includes several capabilities that are not immediately visible:
- Automatic sample image generation. Configure prompts and a step interval to generate preview images during training. Each prompt supports flags:
--dfor seed,--w/--hfor dimensions,--lfor CFG scale,--sfor step count [FluxGym README]. - Hugging Face publishing. Enter your HF token in the UI to publish a trained LoRA directly to Hugging Face.
- Docker support. Install via
docker compose up -d --buildfor containerized deployment. - Pinokio one-click install. Local installation through the Pinokio launcher avoids manual
git cloneandpip installsteps.
Common Errors and Fixes
| Problem | Likely cause | Fix | Source |
|---|---|---|---|
| RunPod page loads indefinitely | Avast or antivirus blocking RunPod API | Disable the antivirus temporarily | Civitai |
| Training fails silently on RunPod | Path missing leading /, or settings not saved | Use /workplace/[path] and save before launching | Civitai |
| OOM on 12 GB GPU | blocks_to_swap too low or missing | Set --blocks_to_swap 16 + --fp8_base | Kohya docs |
| OOM on 10 GB GPU | Need aggressive block swapping + fp8 T5 | Set --blocks_to_swap 22 + download fp8 T5XXL | Kohya docs |
| LoRA outputs look wrong or low quality | --guidance_scale left at default 3.5 | Set --guidance_scale 1.0 for FLUX.1 dev | Kohya docs |
| PyTorch errors on RTX 50-series | Wrong CUDA version | Install cu128 torch nightly + update bitsandbytes | FluxGym README |
FAQ
How slow is FLUX LoRA training on a Colab T4 GPU?
No source provides a concrete measurement. The notebook creator describes T4 training as "a bit slow." The T4's Turing architecture plus block-swapping overhead make it significantly slower than a 48 GB RunPod GPU, but it costs nothing.
Can you train FLUX LoRA with only 10 GB VRAM?
Yes. Kohya's docs recommend --blocks_to_swap 22 plus the fp8-format T5-XXL checkpoint. Community reports describe significant slowdown versus higher-VRAM setups — no independent benchmark pins the exact penalty.
What is --blocks_to_swap and why does it slow training down?
It offloads FLUX.1 transformer blocks from GPU VRAM to CPU RAM during training, then swaps them back on demand. FLUX.1 supports up to 35 blocks for swapping.
Do I need to change FluxGym's Advanced tab settings?
Yes. At minimum, set --guidance_scale 1.0, --timestep_sampling flux_shift, and --model_prediction_type raw for FLUX.1 dev. The Kohya defaults (guidance 3.5, sigma sampling, sigma_scaled predictions) are tuned for other architectures.
Sources
| Source | What it contributed |
|---|---|
| FluxGym GitHub repo | VRAM support tiers, supported models, hidden Advanced tab, Docker/Pinokio/HF features, sample image flags, installation steps |
| FluxGym Colab repo | Colab setup workflow, T4 GPU performance notes, RunPod template link |
| Kohya sd-scripts FLUX training docs | All recommended training parameters, VRAM tier table, blocks_to_swap mechanics, T5 attention mask guidance, recommended timestep/prediction/guidance settings |
| RunPod pricing page | GPU pricing for A40, L40S, A100 |
| Civitai article 6860 | 10/16/24/48 GB GPU configs, 3–5× speed penalty claim for 10 GB, regularization images mention, T5 attention mask testing mention |
| Civitai article 7345 | FluxGym Colab description, Kohya backbone description |
| Civitai article 7431 | RunPod beginner guide, step count advice (3k vs 4k), antivirus/path errors, CrasH dataset guide reference |