Skip to main content
POST
Start Training
Starts a LoRA training run. trainer_id picks the trainer, and each trainer takes its own fields. Pick your trainer in the Body tabs below for a ready-to-send request. The parameter list describes every field; switch its body type to your trainer.

Request

Make a POST request to the endpoint below with the required parameters.

Body

Trains a LoRA for Flux Dev. Ready to generate with on ModelsLab after training.
json

Response

A new run is always queued first. Keep the id: you need it to check the status or stop the run.
json

Errors

Errors come back with HTTP 200 and "status": "error".

Body

application/json
key
string
required

Your API key. Get one from https://modelslab.com/dashboard/api-keys.

trainer_id
enum<string>
required

Selects the Flux LoRA trainer.

Available options:
flux_lora_trainer
images
string<uri>[]
required

Public URLs of your training images, 1 to 100 of them. Every URL is downloaded before the run starts; one that needs a login or does not return an image fails the request.

Required array length: 1 - 100 elements
trigger_word
string
required

A unique word you put in prompts to call up what the LoRA learned. Letters, numbers, spaces, _, . and - only.

Maximum string length: 50
Pattern: ^[\p{L}\p{M}\p{N} _.\-]+$
hf_username
string
required

Your Hugging Face username. The trained LoRA is uploaded to a repo under this account.

Required string length: 3 - 50
hf_token
string
required

A Hugging Face access token (starts with hf_) with write access, so the trainer can create the repo and upload your LoRA.

Minimum string length: 10
training_steps
integer

How many steps to train for. A good starting point is 100 to 150 steps per image. Values above 2000 are trained at 2000.

Required range: 1 <= x <= 2000
Example:

1000

resolution
integer
default:1024

Resolution the images are trained at.

Required range: 520 <= x <= 1024

Response

The run was queued, or an error describing why it was not.

status
enum<string>
Available options:
success
message
string
Example:

"Training request is being processed"

data
object
id
string<uuid>

The training ID. Use it to check status or stop the run.

fetch_result
string<uri>

The status URL for this run.