Skip to main content
AI Tools

How to Train Custom LoRA Models for Flux and Stable Diffusion

Alex MorganAlex MorganNovember 7, 2026Updated: November 7, 202610 min read

Disclosure: Some links in this article are affiliate links. If you click and make a purchase, we may earn a commission at no extra cost to you. This does not influence our editorial recommendations - we only recommend products and services we genuinely believe in. Read our full affiliate disclosure.

How to Train Custom LoRA Models for Flux and Stable Diffusion โ€“ featured image

Last Tuesday, I spent four hours watching a $2.40-per-hour cloud instance burn through my bank account because I set the learning rate for a Flux.1 Dev training run to 0.0005 instead of 0.0001. The result? Every single generated image looked like a neon-drenched deep-fry disaster that could double as a warning label on an energy drink.

If you're tired of paying subscription fees to consumer-facing AI generation apps that water down your likeness or art style, training your own Low-Rank Adaptation (LoRA) is the only real fix. But doing it right requires navigating a minefield of VRAM bottlenecks, bloated datasets, and cloud GPU rental pricing models designed to bleed you dry if you leave an instance running.

RemoGrid is reader-supported. When you sign up or purchase through links on our site, we may earn an affiliate commission at no extra cost to you. We test every platform independently.

We've spent the last three weeks testing training scripts, cloud providers, and dataset curation strategies. This guide breaks down the exact workflow to train production-grade custom LoRAs for both Flux and Stable Diffusion without throwing money away.


The Hardware and Cloud Reality: Local vs. Cloud Training

Before you touch a single line of Python, you need to answer a brutal financial question: do you buy a $1,600 graphics card, or do you rent one for an hour?

If you're running an older card with 12GB or 16GB of VRAM - like an RTX 3060 or 4070 - local training for Flux.1 Dev is practically impossible without running out-of-memory errors that crash your system kernel. Flux is a massive 12-billion parameter beast. Even with 8-bit quantization and gradient checkpointing, you need a minimum of 24GB VRAM just to breathe during a training pass.

Let's look at the actual math of renting versus owning.

Cloud GPU Provider Comparison

ProviderGPU ModelVRAMHourly RateSetup ComplexityBest For
RunPodRTX 409024GB$0.74 - $0.89Medium (Templates)Budget Flux LoRA training
Massed ComputeRTX 6000 Ada48GB$1.95 - $2.40Low (Dedicated templates)Heavy dataset batch sizes
Vast.aiA600048GB$1.10 - $1.60High (P2P bids/interruptions)Advanced users chasing lowest cost
Google Colab ProA100 / V10040GB$10/mo + Compute UnitsLow (Jupyter notebooks)Quick tests and beginners

If you're just getting started with our AI Tools Resource Center, firing up a RunPod RTX 4090 pod with a pre-configured PyTorch template is the fastest way to avoid dependency hell.


Step 1: Dataset Curation (The Part Everyone Screws Up)

Garbage in equals garbage out. No hyper-parameter tuning can save a training run built on 50 blurry smartphone selfies taken in the exact same dim lighting.

When you're building a dataset for a person, style, or object, follow these strict rules:

  1. Resolution Matters: For Flux, your source images should be at least 1024x1024 pixels. Don't upscale low-res images with cheap interpolators; you'll bake artifacts straight into the model weights.
  2. Diversity is Non-Negotiable: If you're training a face, include shots with different expressions, varied lighting (studio, outdoor, overcast), diverse clothing, and different angles.
  3. Keep the Count Lean: You don't need 500 images. For a solid face LoRA, 20 to 30 pristine images are the sweet spot. Anything over 50 risks severe overfitting unless you have thousands of training steps and varied captions.

Captioning Your Images

Flux relies heavily on natural language understanding. If you just dump images into a folder with generic filenames like image_01.jpg, your training results will suffer. You need descriptive captions.

Use an automated tagger like JoyCaption or WD14, or write them by hand in corresponding .txt files matching your image names:

Include a unique trigger word in every single caption - something rare like tkln_person or xyz_style so the model doesn't bleed your concept into generic prompts.


Step 2: Provisioning Your Cloud GPU (RunPod Walkthrough)

Let's spin up a clean environment on RunPod to run our training script.

  1. Create an Account: Head over to RunPod and deposit $10 into your billing balance.
  2. Deploy a Pod: Click Deploy and search for the standard RunPod PyTorch template (pytorch/pytorch).
  3. Select Your Hardware: Choose an RTX 4090 (24GB) or an A6000 (48GB if you have the budget).
  4. Configure Disk Space: Set your container disk to at least 100GB. Flux checkpoints are massive, and you'll need room for your dataset, virtual environments, and output weights.
  5. Launch and Connect: Hit Connect, then open the Jupyter Lab link or SSH directly into your pod via terminal.

How to Train Custom LoRA Models for Flux and Stable Diffusion


Step 3: Setting Up the Training Environment

Once you're inside your pod's terminal, clone the industry-standard training repository. For Flux and modern SDXL/SD3 models, kohya_ss or ai-toolkit by Ostris are the most stable choices. We'll use ai-toolkit because its configuration files are clean YAML structures that don't require messing with massive CLI strings.

Run the following commands in your terminal:

Next, create your Python virtual environment and install the required dependencies:

This installation process takes about three to five minutes depending on the pod's network speed. While that runs, let's look at the financial impact of your training runs.

Training Cost Breakdown (Per Run)

Phase / ItemRTX 4090 (24GB) CostA6000 (48GB) CostTime Invested
Environment Setup$0.15$0.3010 mins
Dataset Prep & Upload$0.00 (Local)$0.00 (Local)30 mins
Flux LoRA Training (1500 steps)$0.90$1.8045 mins
Testing & Evaluation$0.30$0.4515 mins
Total Estimated Cost~$1.35~$2.551 hour 40 mins

Compare that $1.35 cost to monthly subscriptions for managed generation apps that restrict your ownership rights. Training your own model gives you total portability. For related technical setups, check out our guide on Optimizing Remote Work Infrastructure for AI Developers.


Step 4: Configuring the YAML Training File

Inside your ai-toolkit directory, navigate to the config folder. You'll find sample configuration files. Create a new file named flux_lora_train.yaml and paste the following baseline configuration:

Key Parameters to Adjust:

  • rank: Set to 16 for standard character likenesses. If you're training a complex style, bump it to 32. Higher ranks increase file size and training time.
  • lr (Learning Rate): Keep this at 0.0001. If you push it to 0.0005, your model will overfit rapidly and burn out.
  • steps: Aim for 1200 to 1800 steps depending on your dataset size (multiply your image count by 50 to 75).

How to Train Custom LoRA Models for Flux and Stable Diffusion


Step 5: Executing the Training Run and Monitoring Loss

Upload your captioned image folder to /workspace/ai-toolkit/datasets/my_images using Jupyter Lab's upload tool or via an SFTP client.

Once your dataset is in place and your YAML config file is saved, start the training process with this command:

Watch the terminal output closely for the first 50 steps. You want to see the loss metric steadily decline. If the loss spikes erratically or drops to near zero instantly, your learning rate is too high or your dataset has duplicate/corrupt images.

When the training completes, your .safetensors weight files will be waiting in the output/my_custom_flux_lora directory. Download the final checkpoint or the checkpoint from step 1250 if you suspect step 1500 went slightly over.


Step 6: Testing and Integrating Your LoRA

Never trust your training run without running a rigorous evaluation suite. Move your new .safetensors file into your local or cloud ComfyUI or AUTOMATIC1111 weights directory:

Fire up ComfyUI and load a standard Flux workflow. Attach a Load LoRA node between your model loader and your samplers, setting the strength multiplier between 0.8 and 1.0.

Test your trigger word (tkln_person) across three distinct scenarios:

  1. The Direct Prompt: Test if the model renders the exact likeness or style cleanly without contamination.
  2. The Stress Test: Change the clothing, lighting, and background entirely. Does the model maintain identity consistency, or does it collapse back to the base Flux training data?
  3. The Bleed Test: Prompt for something completely unrelated while keeping the LoRA active. If your base style shifts, your training rank was too high or your dataset lacked negative examples.

For more deep dives into managing your digital workflows and avoiding hidden fees when paying for cloud infrastructure, explore our guides in the Fintech and Payments category.


Frequently Asked Questions

How much does it actually cost to train a Flux LoRA on a cloud GPU?

Training a standard Flux.1 Dev LoRA on a RunPod instance running an RTX 4090 or A6000 typically costs between $1.20 and $3.50 per session, depending on dataset size and epoch count. Setup and testing time account for the majority of minor cost fluctuations.

What is the minimum VRAM required to train a Flux LoRA locally?

You need at least 24GB of VRAM (such as an RTX 3090 or 4090) to train a Flux LoRA locally using 8-bit quantization scripts and gradient checkpointing, though 48GB (A6000) is safer for higher resolutions and larger batch sizes.

How many images do I need in my dataset to get good results?

For a face or specific character, 15 to 30 high-resolution images taken from varied angles, lighting conditions, and clothing variations yield the cleanest results without overfitting or memorizing the background elements.

What is the difference between training Flux.1 Dev and Flux.1 Schnell LoRAs?

Flux.1 Dev uses 12 steps of guidance distillation and requires a non-commercial research license, while Schnell is designed for 4-step generation. Dev produces significantly better semantic understanding and detail retention in custom LoRAs, making it the preferred choice for professional work.

Which cloud GPU provider offers the best price-to-performance ratio for training?

RunPod and Massed Compute offer the most reliable hourly rates for RTX 4090 ($0.74 to $0.89/hr) and A6000 ($1.80 to $2.40/hr) instances with pre-configured PyTorch templates that eliminate manual dependency installation headaches.

Why are my generated images burnt or over-saturated after training?

Over-saturation usually happens when your learning rate is set too high (above 0.0002) or you run too many training steps for a small dataset, causing the model to memorize rather than generalize. Lower your learning rate to 0.0001 and reduce your total step count on the next run.

#flux#stable-diffusion#lora-training#ai-tools#gpu-rentals

Frequently Asked Questions

Training a standard Flux.1 Dev LoRA on a RunPod instance running an RTX 4090 or A6000 typically costs between $1.20 and $3.50 per session, depending on dataset size and epoch count.

You need at least 24GB of VRAM (such as an RTX 3090 or 4090) to train a Flux LoRA locally using 8-bit quantization scripts, though 48GB (A6000) is safer for higher resolutions.

For a face or specific character, 15 to 30 high-resolution images taken from varied angles, lighting conditions, and clothing variations yield the cleanest results without overfitting.

Flux.1 Dev uses 12 steps of guidance distillation and requires a non-commercial license, while Schnell is designed for 4-step generation. Dev produces significantly better semantic understanding and detail retention in custom LoRAs.

RunPod and Massed Compute offer the most reliable hourly rates for RTX 4090 ($0.74 to $0.89/hr) and A6000 ($1.80 to $2.40/hr) instances with pre-configured PyTorch templates.

Over-saturation usually happens when your learning rate is set too high (above 0.0002) or you run too many training steps for a small dataset, causing the model to memorize rather than generalize.

Alex Morgan - Founder & Lead Editor
Alex MorganยทFounder & Lead Editor

Alex Morgan is the founder and lead editor of RemoGrid. With over six years of hands-on experience in remote operations, cross-border freelance workflows, and AI tool benchmarking, Alex independently tests and audits software platforms to help modern digital workers build sustainable online income streams. He regularly reviews international payment systems (Wise, Stripe, Payoneer, local mobile wallets) and conducts real-world usability benchmarks across AI productivity tools.

Related Articles

Featured image for Anthropic Computer Use API for FreelancersAI Tools

Anthropic Computer Use API for Freelancers

Deep dive into Anthropic's Computer Use API: real-world freelance applications, GUI automation, prompt engineering, and security for remote work.

#Anthropic#Claude
November 26, 202619 min read
Featured image for Apollo API and Clay Waterfall Enrichment TutorialAI Tools

Apollo API and Clay Waterfall Enrichment Tutorial

Master Apollo.io API and Clay waterfall enrichment to find verified B2B emails, skip single-source errors, and cut bounce rates below 2%.

#clay-com#apollo-io
November 26, 20269 min read
Featured image for Browser-Use AI Agent Guide: Open-Source Web AutomationAI Tools

Browser-Use AI Agent Guide: Open-Source Web Automation

Navigate browser-use AI agents with RemoGrid's expert guide. Learn Playwright, vision models, multi-tab automation, and cost management for open-source web tasks.

#ai agents#web automation
November 26, 202615 min read