Skip to main content
POST
/
styles
/
train
Train a custom style (LoRA)
curl --request POST \
  --url https://api.krea.ai/styles/train \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "urls": [
    "<string>"
  ],
  "model": "flux_dev",
  "type": "Default",
  "trigger_word": "<string>",
  "learning_rate": 123,
  "max_train_steps": 1000,
  "batch_size": 2
}
'
{
  "job_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "status": "queued",
  "created_at": "2023-11-07T05:31:56Z",
  "completed_at": "<unknown>",
  "result": "<unknown>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

X-Webhook-URL
string<uri>

URL to receive a POST request when the job completes. The webhook will receive the job data including results.

Body

application/json
name
string
required
urls
string<uri>[]
required
model
enum<string>
default:flux_dev
Available options:
flux_dev,
flux_schnell,
wan,
wan22,
qwen
type
enum<string>
default:Default
Available options:
Style,
Object,
Character,
Default
trigger_word
string
learning_rate
number
max_train_steps
integer
Required range: 1 <= x <= 2000
batch_size
integer
Required range: x >= 1

Response

Training job created successfully. The job will be in a pending state until completed. Use /jobs/{id} to check progress.

job_id
string<uuid>
required
status
enum<string>
required
Available options:
queued,
scheduled,
processing,
sampling,
intermediate-complete,
completed,
failed,
cancelled
created_at
string<date-time>
required
completed_at
null
required
result
null
required