multimodalart/krea2-lora-trainer
Krea 2 LoRA Trainer
Train a DreamBooth-LoRA for Krea 2 from your own images, entirely on Hugging Face infrastructure:
- Sign in with Hugging Face — the dataset, the job, and the pushed LoRA all run under your account and billing (no pasted tokens);
- the Space (this app,
cpu-basic) collects your images + hyperparameters and submits a job; - training runs on HF Jobs using the diffusers Krea 2 trainer (
examples/dreambooth/train_dreambooth_lora_krea2.py); - the LoRA is trained on Krea 2 RAW and validated / inferred on Krea 2 Turbo, then pushed to the Hub model repo you choose.
You only pay for the Job's actual GPU runtime.
How tokens are used
Three tokens, three jobs:
- Your OAuth token (from sign-in) — your dataset repo + the pushed LoRA, under your account/billing.
- `KREA_TOKEN` secret — downloads the gated Krea 2 weights inside the job and passes them to the trainer as local dirs, so your own token never needs Krea access and the Krea token never touches your repos.
- `CAPTION_HF_TOKEN` secret — calls the Inference API for AI captioning on this Space only (
google/gemma-4-31B-it, served with vision via thenovitaprovider).
SetKREA_TOKENto a token with access tokrea/Krea-2-Raw+krea/Krea-2-Turbo, andCAPTION_HF_TOKENto any token that can call Inference Providers.
Captioning
Pick whether you're training a style or an object/character — this drives both the suggested trigger and how images are captioned:
- Style — captions describe only the content (subjects, layout, setting) and end with your style trigger phrase (e.g. heavy impasto style), so the model learns the look, not the subjects.
- Object/character — captions describe the scene and tag the subject with a unique trigger token (e.g. b3@rcup).
✨ Suggest proposes a trigger from 2–3 of your images; ✨ Add AI captions fills every caption. Everything is editable; blank captions fall back to the trigger.
Preview gallery & README
After training, the job renders a few sample images on Krea 2 Turbo with your LoRA and pushes a model-card README to the LoRA repo where each image is captioned by its prompt. The showcase prompts are written by the LLM from your concept + trigger (or you can supply your own, one per line, using <trigger> as a placeholder). The trainer's own validation is skipped in favour of this.
diffusers version
The trainer lives in diffusers PR #14046 (branch krea2-lora). Once it is merged, set the DIFFUSERS_REF Space variable to main (or a release tag).
Usage
- Sign in with Hugging Face.
- Name your LoRA and pick what you're training — a style or an object/character.
- Upload 4–30 images, ✨ Suggest a trigger, and ✨ Add AI captions (edit anything).
- Tweak hyperparameters if you like, choose how many preview samples to render, pick a GPU flavor, and Submit training job.
- Copy the job id into the Monitor tab and Refresh to stream logs. When it finishes, the LoRA repo has the weights, a preview gallery, and a rich README.
