Lora Training Start
POST
/api/lora-training/start
const url = 'https://example.com/api/lora-training/start';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"job_name":"mycharacter_flux2_v1","trigger_word":"mycharacter","base_config":"flux2_character","dataset":"mycharacter_dataset_v1","model":"flux2_dev","model_name_or_path":"black-forest-labs/FLUX.2-dev","lora_rank":1,"lora_alpha":1,"steps":1,"learning_rate":1,"batch_size":1,"optimizer":"example","resolution":[1],"caption_dropout_rate":1,"cache_text_embeddings":true,"low_vram":true,"save_every":1,"sample_every":1,"sample_prompts":["example"],"sample_width":1,"sample_height":1,"sample_steps":1,"sample_guidance_scale":1,"sample_seed":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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_character", "dataset": "mycharacter_dataset_v1", "model": "flux2_dev", "model_name_or_path": "black-forest-labs/FLUX.2-dev", "lora_rank": 1, "lora_alpha": 1, "steps": 1, "learning_rate": 1, "batch_size": 1, "optimizer": "example", "resolution": [ 1 ], "caption_dropout_rate": 1, "cache_text_embeddings": true, "low_vram": true, "save_every": 1, "sample_every": 1, "sample_prompts": [ "example" ], "sample_width": 1, "sample_height": 1, "sample_steps": 1, "sample_guidance_scale": 1, "sample_seed": 1 }'Build the training config locally, then enqueue and start via ai-toolkit UI API.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
LoraTrainingStartRequest
A training run. Only the first block is needed.
The recipe (rank, learning rate, resolution, steps, previews) comes from the template
named by base_config, taken from that model’s sources. Every field under
“Overrides” defaults to the template’s value; set one only to deliberately depart
from it.
object
job_name
required
Job Name
string
trigger_word
required
Trigger Word
string
base_config
Base Config
Training template name; resolves to
string
dataset
required
Dataset
Dataset folder name inside the trainer’s DATASETS_FOLDER (see GET /api/lora-training/trainer)
string
model
Model
Base model label, stored with the job
string
model_name_or_path
Model Name Or Path
Base checkpoint: a Hugging Face repo id, or for SDXL a single .safetensors path on the trainer
string
resolution
Any of:
Array<integer>
null
sample_prompts
Any of:
Array<string>
null
Responses
Section titled “Responses”Successful Response
Media typeapplication/json
LoraTrainingStartResponse
object
Examplegenerated
{ "ok": true, "job_name": "example", "status": "example", "config_path": "example", "output_dir": "example", "sample_prompts": [ "example" ], "error": "example"}Validation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ]}