Skip to content

Lora Training Start

POST
/api/lora-training/start
curl --request POST \
--url https://example.com/api/lora-training/start \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "job_name": "mycharacter_flux2_v1", "trigger_word": "mycharacter", "base_config": "flux2_identity", "dataset": "mycharacter_dataset_v1", "model": "flux2_dev", "model_name_or_path": "black-forest-labs/FLUX.2-dev", "low_vram": false, "layer_offloading": false, "transformer_quantization": "qfloat8", "te_quantization": "qfloat8", "lora_rank": 32, "steps": 1800, "learning_rate": 0.0001, "batch_size": 1, "gradient_accumulation": 1, "optimizer": "adamw8bit", "weight_decay": 0.0001, "timestep_type": "weighted", "loss_type": "mse", "cache_text_embeddings": true, "unload_text_encoder": false, "resolution": [ 768, 896, 1024 ], "caption_dropout_rate": 0, "cache_latents": true, "dop_enabled": false, "preservation_class": "photo", "differential_guidance": false, "differential_guidance_scale": 3, "sample_every": 250, "sample_steps": 25, "sample_width": 1024, "sample_height": 1024, "sample_guidance_scale": 1, "sample_seed": 42, "sample_prompts": [ "example" ] }'

Build the training config locally, then enqueue and start via ai-toolkit UI API.

Media typeapplication/json
LoraTrainingStartRequest
object
job_name
required
Job Name
string
>= 1 characters /^[a-zA-Z0-9_-]+$/
trigger_word
required
Trigger Word
string
>= 1 characters
base_config
Base Config

Training template name; resolves to _template.yaml in the training dir

string
default: flux2_identity
dataset
required
Dataset

Dataset folder name on the droplet under /root/flixml-training/datasets/

string
>= 1 characters
model
Model

Base model label, stored with the job

string
default: flux2_dev
model_name_or_path
Model Name Or Path

Hugging Face repo id for the base checkpoint

string
default: black-forest-labs/FLUX.2-dev
low_vram
Low Vram

Enable Low VRAM mode (Tier A 16-24 GB)

boolean
layer_offloading
Layer Offloading

Stream layers from CPU RAM (Tier A only)

boolean
transformer_quantization
Transformer Quantization
string
default: qfloat8
Allowed values: qfloat8 uint4 none
te_quantization
Te Quantization
string
default: qfloat8
Allowed values: qfloat8 uint4 none
lora_rank
Lora Rank
integer
default: 32 >= 4 <= 128
steps
Steps
integer
default: 1800 >= 100 <= 10000
learning_rate
Learning Rate
number
default: 0.0001 >= 0.000001 <= 0.01
batch_size
Batch Size
integer
default: 1 >= 1 <= 8
gradient_accumulation
Gradient Accumulation
integer
default: 1 >= 1 <= 16
optimizer
Optimizer
string
default: adamw8bit
Allowed values: adamw8bit adamw sgd
weight_decay
Weight Decay
number
default: 0.0001 <= 0.1
timestep_type
Timestep Type
string
default: weighted
Allowed values: weighted sigmoid
loss_type
Loss Type
string
default: mse
Allowed values: mse l1 huber
cache_text_embeddings
Any of:
boolean
unload_text_encoder
Unload Text Encoder

Unload TE after caching embeddings (VRAM saver)

boolean
resolution
Resolution

Resolution buckets for training

Array<integer>
default: 768,896,1024
caption_dropout_rate
Caption Dropout Rate

Dropout rate for captions; set 0 when cache_text_embeddings is on

number
0 <= 1
cache_latents
Cache Latents

Cache VAE latents to disk to save VRAM

boolean
default: true
dop_enabled
Dop Enabled

Differential Output Preservation - keep base model behaviour outside your trigger

boolean
preservation_class
Preservation Class

Neutral class word for DOP non-trigger path

string
default: photo
differential_guidance
Differential Guidance

Exaggerate the gap toward target for faster detail lock-in

boolean
differential_guidance_scale
Differential Guidance Scale
number
default: 3 >= 1 <= 10
sample_every
Sample Every
integer
default: 250 >= 50 <= 5000
sample_steps
Sample Steps
integer
default: 25 >= 10 <= 100
sample_width
Sample Width
integer
default: 1024 >= 512 <= 2048
sample_height
Sample Height
integer
default: 1024 >= 512 <= 2048
sample_guidance_scale
Sample Guidance Scale
number
default: 1 <= 10
sample_seed
Sample Seed
integer
default: 42
sample_prompts
Sample Prompts
Array<string>

Successful Response

Media typeapplication/json
LoraTrainingStartResponse
object
ok
required
Ok
boolean
job_name
required
Job Name
string
status
required
Status
string
config_path
required
Config Path
string
output_dir
required
Output Dir
string
error
Any of:
string
Examplegenerated
{
"ok": true,
"job_name": "example",
"status": "example",
"config_path": "example",
"output_dir": "example",
"error": "example"
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}