ArtificialGuyBR

Home / Blog / Training LoRAs

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.

6 sources cited Training LoRAs

FluxGym FLUX LoRA Training Guide: Colab, RunPod, and Hidden Settings

TL;DR

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

  1. Open the Colab notebook linked above.
  2. Run all cells to install FluxGym and its dependencies (PyTorch nightly, Kohya sd-scripts from the sd3 branch).
  3. Wait for the Gradio interface to launch — a public URL appears in the output.
  4. 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:

SettingDefault value (in Kohya)Recommended value for FLUX.1What it doesSource
--guidance_scale3.51.0Disables classifier-free guidance for training (FLUX.1 dev is distilled with CFG baked in)Kohya docs
--timestep_samplingsigmaflux_shiftShifts timestep distribution based on resolution, matching FLUX.1 dev inferenceKohya docs
--model_prediction_typesigma_scaledrawUses raw model predictions without sigma scalingKohya docs
--blocks_to_swap0 (none)16–22 depending on VRAMOffloads transformer blocks to CPU RAMKohya docs
--apply_t5_attn_maskOffOff for FLUX (required for Chroma)Applies attention masks to T5-XXL text encoderKohya 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 VRAMRequired settingsNotes
24 GBBasic settings, batch size 2No block swapping needed
16 GBBatch size 1 + --blocks_to_swapColab T4 falls here
12 GB--blocks_to_swap 16 + AdamW8bit
10 GB--blocks_to_swap 22 + fp8 T5XXL checkpointCommunity reports significant slowdown vs higher-VRAM tiers
8 GB--blocks_to_swap 28 + fp8 T5XXL checkpointMaximum 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

GPUVRAMPrice/hrBest for
A4048 GB$0.44Budget FLUX.1 dev training, batch size 2
L40S48 GB$0.99Faster training, same VRAM tier
A100 PCIe80 GB$1.39Large batch sizes, minimal swapping
A100 SXM80 GB$1.49Fastest 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:

Common Errors and Fixes

ProblemLikely causeFixSource
RunPod page loads indefinitelyAvast or antivirus blocking RunPod APIDisable the antivirus temporarilyCivitai
Training fails silently on RunPodPath missing leading /, or settings not savedUse /workplace/[path] and save before launchingCivitai
OOM on 12 GB GPUblocks_to_swap too low or missingSet --blocks_to_swap 16 + --fp8_baseKohya docs
OOM on 10 GB GPUNeed aggressive block swapping + fp8 T5Set --blocks_to_swap 22 + download fp8 T5XXLKohya docs
LoRA outputs look wrong or low quality--guidance_scale left at default 3.5Set --guidance_scale 1.0 for FLUX.1 devKohya docs
PyTorch errors on RTX 50-seriesWrong CUDA versionInstall cu128 torch nightly + update bitsandbytesFluxGym 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

SourceWhat it contributed
FluxGym GitHub repoVRAM support tiers, supported models, hidden Advanced tab, Docker/Pinokio/HF features, sample image flags, installation steps
FluxGym Colab repoColab setup workflow, T4 GPU performance notes, RunPod template link
Kohya sd-scripts FLUX training docsAll recommended training parameters, VRAM tier table, blocks_to_swap mechanics, T5 attention mask guidance, recommended timestep/prediction/guidance settings
RunPod pricing pageGPU pricing for A40, L40S, A100
Civitai article 686010/16/24/48 GB GPU configs, 3–5× speed penalty claim for 10 GB, regularization images mention, T5 attention mask testing mention
Civitai article 7345FluxGym Colab description, Kohya backbone description
Civitai article 7431RunPod beginner guide, step count advice (3k vs 4k), antivirus/path errors, CrasH dataset guide reference