Chapter 02: Train an Adapter
Build a 15–20 image Dreambooth dataset with a trigger token and run your first mflux training from a JSON config.
TUTOR WITH THEFOCUS.AI
Copy this prompt into Claude, ChatGPT, or any external AI assistant. It points the assistant to the course instructions and links it to your student profile to track your progress and customize observations.
You are not enrolled yet. Enroll to generate a Student ID to track lesson completions and store learning notes.
Chapter 02: Train an Adapter
The Dataset
15–20 images of one subject. A person, an object, a place. Pick something you have a lot of photos of and can judge quality on instantly — that instant judgment is the whole point of doing images first.
- Consistent subject, varied background/lighting/angle
- 512×512 (mflux’s training default)
- Captions using a rare trigger token (
TOK,sks, whatever) so the model binds the concept to a handle it isn’t already using
Training
Dreambooth training in mflux is driven entirely by a JSON config — training parameters cannot be passed as CLI flags. Start from the bundled example:
cd mflux
mflux-train --train-config src/mflux/dreambooth/_example/train.json
Copy that config, point it at your dataset, edit the examples section. Default is 512×512, batch size 1.
Expect several hours for a full run depending on machine and step count. Use --low-ram if memory pressure goes yellow — it constrains the MLX cache and releases the text encoders and transformer components after use.
While It Trains
Read the mflux source (Chapter 01’s homework). Or write down your predictions: what do you expect rank 64 on 5 images to produce? What about 2000 steps on 15 images? You’ll check these predictions in Chapter 03.
Known Failure Modes
- “None of my LoRAs look good.” Known territory — early Dreambooth-on-MLX results were widely reported as poor, and adapters trained in one tool didn’t always load in another. Don’t over-index on quality; you’re here for the deltas between runs, not a shippable adapter.
- Slowdowns after interleaving generation with training. Documented issue. Train, then generate. Don’t interleave.