Language

How to train a Flux LoRA (Flux.1 and Flux 2): the step-by-step beginner guide

Flux LoRA training is how you teach the Flux image model something it does not know: your face, your product, your drawing style, a camera look. The result is one .safetensors file of 20 to 300 MB that you can use in any Flux app, including Graydient. The process takes 15 to 30 pictures, a card with 12 to 16 GB of memory (or a rented one for an hour), and a free trainer. This guide walks through every step for Flux.1 dev and for Flux 2, and ends with how to run your new LoRA here.

You will do seven things: pick the Flux base, build a small dataset, write captions, choose a trainer, set a handful of numbers, train and test, then import the file into Graydient. Each step is written out below with the values that work for most people. If you already have a trained file, jump to the section on using it.

Graydient runs LoRAs; it does not train them. Training happens on your own graphics card, on a GPU you rent by the hour, or in an online trainer. Once the file exists, every Graydient plan can render with it for one flat price.

What you need

Step 1: pick the Flux base to train on

A LoRA is bound to the base model it was trained on, so start with the base you want to render with. The Flux family has three branches that do not share LoRAs:

BaseMemory to trainWhere the LoRA runs afterwards
Flux.1 dev12 to 16 GB with the base in fp8 and an 8-bit optimizer; 24 GB is comfortableFlux.1 dev, Flux.1 schnell (weaker), Flux Krea dev and the many Flux.1 fine-tunes. On Graydient: <flux-dev>. The largest LoRA ecosystem; pick this if unsure.
Flux 2 Klein 4B12 to 16 GB; train on the Klein 4B Base checkpoint, not the 4-step distilled oneKlein 4B and Klein 4B based checkpoints only. Fast to train and fast to render; Apache 2.0 licence.
Flux 2 Klein 9BAbout 24 GB; train on the Klein 9B Base checkpointKlein 9B only. Better detail than 4B, non-commercial licence.
Flux 2 dev24 GB minimum, 48 GB comfortable; rent for this unless you own a 4090 or 5090Flux 2 dev and Flux 2 dev based checkpoints. On Graydient: <flux2>. The highest quality, the slowest to train.

The rule to remember: Flux.1 LoRAs do not work on Flux 2, Flux 2 LoRAs do not work on Flux.1, and Klein 4B, Klein 9B and Flux 2 dev each need their own LoRA. Krea 2 is a different model, not Flux. If you use several bases, train once per base from the same dataset.

Step 2: build the dataset

Flux learns fast from small, clean datasets. Quality beats count; 20 sharp and varied pictures beat 80 near-duplicates.

  1. Collect 15 to 30 pictures for a person, product or object. Change the angle, the distance, the lighting and the background between shots. Include at least a third close-ups and a third full body or full product.
  2. For a style, collect 30 to 60 works with the same medium and line quality but different subjects: people, places, objects. The variety is what tells the trainer the subject is not the style.
  3. Remove blur, heavy compression, watermarks, text overlays and anyone who is not the subject. One stray face in the set will show up in renders.
  4. Resolution: 1024 pixels on the long side is the standard for Flux. Keep aspect ratios mixed; every trainer buckets them automatically. Do not stretch pictures to squares.
  5. Put the pictures in one folder with a text file next to each picture that has the same name. The caption goes in the text file: dataset/01.jpg dataset/01.txt dataset/02.jpg dataset/02.txt

Step 3: write the captions

Flux reads natural sentences through its T5 text encoder, so captions are plain descriptions, not keyword lists. The captions decide what the LoRA learns and what it leaves alone:

A subject caption for a person LoRA: ohwx woman, wearing a grey wool coat, standing on a stone bridge, overcast daylight, looking at the camera

A caption for a style LoRA, where the style is deliberately not mentioned: a fishing boat in a harbour at dawn, two men on the pier, fog over the water

Step 4: choose a trainer

Four free, open-source trainers cover every Flux base. They all take the same dataset folder and produce the same kind of .safetensors file:

Step 5: set the five numbers that matter

Every trainer exposes dozens of options. Leave the defaults alone except these, which decide how strong, how general and how large the LoRA is:

SettingFlux.1 devFlux 2 Klein 4B (Base)
Network rank (dim)16 for a face or object, 32 for a detailed style16; 32 for styles
AlphaEqual to the rankEqual to the rank
Learning rate1e-4 to 2e-4 (Prodigy or Adafactor if the trainer offers it)1e-4
Steps1000 to 2000, so each picture is seen 60 to 120 times1000 to 2000
Resolution1024 (768 if memory is short)1024
Batch size1 (2 on 24 GB)1 or 2
Base precisionfp8 base with an 8-bit optimizer on 12 to 16 GB; bf16 on 24 GB and upbf16 fits on 16 GB; fp8 on 12 GB

Set the trainer to save a checkpoint every 250 steps and to render two sample pictures at each save, with the same prompt and seed. These samples are how you will pick the winner. Flux.1 dev and Flux 2 dev are guidance-distilled; the trainers handle that for you, so leave the guidance setting at its default.

Step 6: train

  1. Start the run and watch the memory for the first minute. If it fills the card and spills into system memory, stop: training will take ten times longer and may crash.
  2. If memory spills, switch the base to fp8, turn on gradient checkpointing, use the 8-bit AdamW or Adafactor optimizer, drop the resolution to 768, and keep the batch at 1. Any one of these frees gigabytes.
  3. Once it runs clean, leave it alone. Flux.1 dev takes one to two hours for 1500 steps on a 16 GB card; Klein 4B is faster; Flux 2 dev takes about an hour on a rented 48 GB card.
  4. Look at the sample pictures as they appear. The subject usually shows up by step 500 and is solid by 1000. If it is perfect at 750, you may stop early.

Training is slow and noisy, not fragile. A run that survives the first minute almost always finishes. Cache the latents and text embeddings before training if your trainer offers it; it saves memory and time on every run.

Step 7: test and pick the right checkpoint

The last checkpoint is rarely the best. Overtrained LoRAs copy the dataset's backgrounds, burn the contrast and stop listening to prompts. Test them all:

No graphics card? Rent one for an hour

Flux 2 dev training, or any Flux training on a laptop, is cheaper on a rented card than on your own time. A 24 or 48 GB card costs well under the price of a coffee per hour on GPU rental marketplaces, and a Flux LoRA needs one to two hours.

Use your Flux LoRA on Graydient

Graydient does not need the file on your computer to render with it. Put it where Graydient can fetch it and import the link:

  1. Upload the .safetensors file to a repository in your Hugging Face account (public or private), or publish it on Civitai with the base model set to the Flux version you trained on.
  2. log in to Graydient, open Model Import from your dashboard library, and paste the direct file link from Hugging Face or the Civitai page link. The full steps are in how to import Civitai and Hugging Face models on Graydient.
  3. Wait for the LoRA to appear in your library and copy the ShortCode Graydient gave it.
  4. Render with the LoRA tag and the matching base in any Graydient app: <lora:my-flux-lora:0.8> <flux-dev> for a Flux.1 LoRA, or <lora:my-flux2-lora:0.8> <flux2> for a Flux 2 LoRA. Every app, weight and stacking rule is in the beginner guide to Flux and Flux 2 LoRAs on Graydient.

A complete first render for Telegram or Discord, with the trigger word first and the LoRA at 0.8 on the Flux dev base: /render ohwx woman, portrait, soft window light, 85mm photo <lora:my-flux-lora:0.8> <flux-dev> /steps:24 /guidance:3.5 /size:1024x1024

Licences: what you may do with the LoRA

A LoRA is a derivative of its base model, so the base licence travels with it. Check the current licence text on the model page before you sell renders or the file:

If something goes wrong

That is the whole method: one base, 20 clean pictures, honest captions, five numbers, a run, a test. Your first Flux LoRA will not be your best, and the second one takes half the time. When the file exists, log in to Graydient or compare plans and pricing to render with it as many times as you like. Every plan includes a 7-day money-back guarantee.

Questions

Can Graydient train a Flux LoRA for me?

No. Graydient is a flat-rate rendering service; it runs LoRAs but does not train them. Train on your own card, a rented one or an online trainer as described above, then import the file. Rendering with it afterwards costs nothing extra on any plan.

How many pictures do I need for a Flux LoRA?

15 to 30 for a face, product or object; 30 to 60 for a style. Flux learns from small sets. Past 100 pictures you are fine-tuning, not training a LoRA, and you need more steps and memory.

How much VRAM does Flux LoRA training need?

12 to 16 GB for Flux.1 dev or Flux 2 Klein 4B with the base in fp8 and an 8-bit optimizer. About 24 GB for Klein 9B. 24 GB minimum and 48 GB comfortable for Flux 2 dev. Rent for the last two unless you own a 4090 or 5090.

How long does it take?

One to two hours for Flux.1 dev on a 16 GB card at 1500 steps, less for Klein 4B, and about an hour for Flux 2 dev on a rented 48 GB card. Captioning and testing add another hour the first time.

Can I train a Flux 2 LoRA the same way as a Flux.1 LoRA?

Yes, with the same dataset and captions. Train Klein LoRAs on the Klein Base checkpoints (4B Base or 9B Base), not on the 4-step distilled ones, and remember that the result only runs on that one Klein size. Flux 2 dev needs more memory, so most people rent for it.

Do I need a trigger word for a Flux LoRA?

For a person or object, yes: a made-up word at the start of every caption, which you then put at the start of every prompt. For a style, no trigger word is needed if the captions describe the content and not the style; the LoRA then applies to everything.

Can I keep the LoRA private?

Yes. Upload it to a private Hugging Face repository and import the file link while logged in to Hugging Face; Graydient only fetches files your account may download. Your library is yours alone, and the file never appears on ModelTrends or anywhere public.

See plans and pricing