LoRA Training with FluxGym in Google Colab
Workflow

Step-by-Step Guide to LoRA Training with Flux Gym in Google Colab

Sep 12, 2024 · The Local Lab

Want to train a custom Flux LoRA but don't have a high-end GPU? Google Colab gives you free access to cloud GPUs that are more than capable of running the job — and with FluxGym's Gradio interface, the whole process is point-and-click. No command line, no complicated setup, no expensive hardware.

This guide walks you through the complete process from opening the Colab notebook to downloading a finished .safetensors LoRA file ready to drop into ComfyUI.

Already read our RunPod guide? This guide covers the same FluxGym interface but using free Google Colab instead of paid RunPod cloud GPUs. If speed and reliability matter more than cost, check out our RunPod FluxGym guide as well.

Colab vs RunPod — Which Should You Use?

Google Colab (Free)

  • Free GPU access (T4 or TPU)
  • Session time limits apply
  • Can disconnect unexpectedly
  • Great for learning and experimenting
  • No credit card needed to start

RunPod (Paid ~$0.50/run)

  • Faster, more powerful GPUs
  • No session time limits
  • More reliable for longer runs
  • Better for production training
  • Small cost per run

If you're new to LoRA training, start here with Colab. It's the lowest-friction way to get your first successful run and understand the workflow before committing to paid compute.

What You'll Need

Preparing Your Training Images

Good training data is the single biggest factor in LoRA quality. Spend time here and the training will take care of itself.

Step-by-Step: Training in Google Colab

1
Open the FluxGym Colab Notebook

Go to the fluxgym-Colab GitHub repo and click "Open in Colab." Make a copy to your own Drive so your changes are saved.

2
Switch to GPU or TPU runtime

Go to Runtime → Change runtime type and set the Hardware Accelerator to T4 GPU (recommended for free tier) or TPU if available. Click Save. This is critical — without a GPU the training will be extremely slow.

3
Run the setup cells top to bottom

Click the play button on each cell in order, starting from the top. These cells install dependencies, clone the FluxGym repo, and download the Flux model weights. This can take 5–10 minutes on first run — let each cell complete before moving to the next.

4
Launch the Gradio interface

The final setup cell runs a Python command that starts the FluxGym Gradio server. Once it's ready, Colab will display a public shareable link (e.g. https://xxxxxx.gradio.live). Click it to open the FluxGym UI in a new tab.

5
Name your LoRA and set a trigger word

In the FluxGym UI, give your LoRA a descriptive name and set a trigger word — a unique term that activates the LoRA in prompts. Use something specific and made-up (e.g. dreamstyle, myphoto, zxqface) so it doesn't conflict with words the base model already knows.

6
Upload your training images

Drag your prepared images into the upload area. FluxGym will display them in a grid for review. Remove any that don't meet the quality bar before proceeding.

7
Auto-caption with Florence 2

Click Caption Images. FluxGym runs Florence 2 over your dataset to generate text descriptions for each image. Review the captions and manually add your trigger word to each one — this is important for reliable activation during inference.

8
Set training parameters

For free Colab with a T4 GPU, select 16GB VRAM in the settings. Keep epochs between 10–20 and repeat values between 1–3 to start. Lower values train faster but may produce weaker results — you can iterate. Leave other settings at default for your first run.

9
Start training and watch the progress

Click Start Training. FluxGym shows a live log and sample images at checkpoints. On a free T4 GPU this typically takes 20–40 minutes depending on your dataset size and epoch count. Keep the browser tab open — Colab sessions can disconnect if idle.

10
Download your LoRA

When training completes, find the output .safetensors file in the Colab file browser (left sidebar → Files) under the FluxGym output directory. Right-click and download it. This is your finished LoRA — ready to use in ComfyUI or any Flux-compatible tool.

Testing Your LoRA in ComfyUI

Drop the .safetensors file into your ComfyUI models/loras folder. In your workflow, add a Load LoRA node between your model loader and the sampler. Set strength to 0.8–1.0 and include your trigger word in the positive prompt.

Test with a simple prompt first — just your trigger word plus a basic scene description. If the output reflects your training subject, the LoRA is working. If it's too strong or "burned in," lower the strength. If it's not activating, try increasing steps or retraining with a higher epoch count.

Tip: Save Colab sessions frequently by downloading your LoRA at intermediate checkpoints (e.g. after epoch 10 and epoch 20). Free Colab sessions can expire and you'll lose your work if you don't save the output files before disconnect.

When to Upgrade to RunPod

Colab is perfect for learning the workflow and experimenting with small datasets. You'll want to move to RunPod (or another paid GPU provider) when:

Watch the full video above for a hands-on walkthrough of every step — including what the UI looks like at each stage and what good vs. poor training output looks like at the checkpoint previews.

Resources & Downloads

// Related reading

Train Custom LoRAs on Flux with FluxGym on RunPod

Ready to run Flux locally?

Our one-click ComfyUI installer gets you up and running with Flux in under 5 minutes — no command line needed.

Browse the Store ← More Articles