Krea 2 LoRA Trainer

A versioned training recipe for Krea 2 LoRAs. It covers the hyperparameters, the ostris/ai-toolkit config template, how a run is sized, and how the result is validated. It contains config only, no weights.

Files

File Contents
job.json Hyperparameters, step sizing, preview schedules per base, training adapters, the ai-toolkit config template, and the validation policy.
workflow.json Version manifest: tag, release note, the run's inputs, and runtime (container image, entrypoint, minimum VRAM).
catalog/ Catalog card and thumbnail.

Versions

Each release is an immutable git tag (v1, v2, …). Never move a tag; any change to job.json or runtime is a new tag. main carries docs only, so pin a tag when you use the recipe.

git clone --branch v1 https://huggingface.co/abide1622/ldc-workflow-krea2-lora
Tag Trainer Notes
v1 ostris/aitoolkit:0.13.23 First release. Validated end to end on Raw (3,000 steps on an H100, about 1.34 s/step).

v1 settings

Network LoRA, rank 16, alpha 16
Optimizer AdamW 8-bit, lr 1e-4, flowmatch, linear timesteps, bf16
Resolution 1024
Caption dropout 0.05
Model quantized transformer and text encoder, low_vram, gradient checkpointing
Saves / previews about 6 per run, every max(50, ⌈steps/300βŒ‰Β·50) steps
Default steps 50 per image, clamped to 1,000–3,000
GPU β‰₯ 48 GB VRAM
Base Previews Training adapter
krea2-raw CFG 4.0, 25 steps none
krea2-turbo CFG 1.0, 9 steps ostris/krea2_turbo_training_adapter

LoRAs trained on Raw transfer to Turbo.

Running a job

  1. Dataset. Put images in one flat folder, each with an optional same-named .txt caption. Write the trigger word into each caption yourself. The config leaves ai-toolkit's trigger_word unset, so nothing adds it a second time.

  2. Render the config. config_template in job.json is an ai-toolkit config with placeholders:

    • {"$job": "<name>"} is replaced by that value, and is required.
    • {"$job?": "<name>"} is removed when unset. An object left empty by removals is removed too.
    Placeholders Value
    name, output_dir, dataset_dir, checkpoint_path Job name and paths
    steps, checkpoint_every, sample_prompts Per job
    arch, rank, learning_rate, optimizer, timestep_type, caption_dropout_rate, resolution From job.json β†’ arch and hyperparameters
    guidance_scale, sample_steps From job.json β†’ schedules[<base>]
    assistant_lora_path (optional) From job.json β†’ training_adapters[<base>]
    text_encoder_path, vae_path (optional) Local copies; omit them to let ai-toolkit download its own

    Keep the template's key order when writing YAML.

  3. Run it in the pinned image with the entrypoint from workflow.json. The entrypoint runs from /app/ai-toolkit, inside the image:

    docker run --gpus all -v "$PWD:/workspace" -w /app/ai-toolkit --entrypoint "" \
      ostris/aitoolkit:0.13.23 python run.py /workspace/job/config.yaml
    

    Wrap the run in a wall-clock limit (timeout). A run that is stopped still leaves its most recent checkpoint.

Validation

job.json β†’ validation defines when a trained LoRA counts as passing:

  • Structure: the file has LoRA modules at the configured rank, for the base it was trained on.
  • Smoke test: one text-to-image generation on the training base, run twice at a fixed seed (424242), once without the LoRA and once with it.
    • Effect: the mean absolute pixel difference (0–255, at 256Γ—256) must be β‰₯ 4.0, which proves the LoRA was applied.
    • Sanity: both images must have a standard deviation β‰₯ 8.0, which proves neither is a flat field.

A pass means the LoRA loads and changes the image without breaking it. It does not measure how well the concept was learned.

Contributing

Open a discussion or pull request against main. A change to the recipe ships as a new tag.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for abide1622/ldc-workflow-krea2-lora

Base model

krea/Krea-2-Raw
Adapter
(1,268)
this model