LoRAs

Train and save a LoRA Style

Changed on

Trains a LoRA through the same dataset preparation, captioning defaults, authorization, billing and saved Style lifecycle as the web Train dialog. Upload image files through the assets API first, then pass their Flora URLs. Returns a run_id for GET /runs/{runId} and style_id for GET /loras/{styleId}; use the ready style_id as params.lora_id with a compatible inference model. Training spends workspace usage. Persist client_token before dispatch and reuse it with identical inputs to recover a lost response. The optional Idempotency-Key header separately rejects duplicate HTTP requests for two hours with idempotency_duplicate.

post/loras/train

Request

  • Base URL
    https://app.flora.ai/api/v1
  • URL
    https://app.flora.ai/api/v1/loras/train
  • Auth
    HTTP bearer

Request body

workspace_idstring required

Workspace to authorize and bill for training

project_idstring required

Project that owns the training run

namestring required

Name of the saved Style

base_modelstring required

LoRA base-model family key, such as flux-2 or krea-2, from the Flora Train dialog

image_urlsstring[] required

Training images uploaded to Flora. The selected trainer enforces its own image-count range. External URLs must first be uploaded through the assets API.

captionsstring[]

Optional per-image captions in image_urls order. Null or blank entries use the shared training flow's fallback caption. Omit to use the same captioning defaults as the web Train dialog.

trainer_paramsobject

Model-specific training parameters, such as steps, learning_rate or captioning mode. Omitted parameters use the same defaults as the web Train dialog. Parameters are validated by the shared trainer preparation service.

client_tokenstring required

Lowercase UUID for this logical training request. Persist it before submitting and reuse it with the same inputs after a lost response; do not create a new token for a retry.

Example request

{
  "workspace_id": "ws_abc123",
  "project_id": "prj_abc123"
}

Response

Training accepted, or the existing request recovered.

style_idstring nullable required

Saved Style identifier

run_idstring required

Training run identifier; poll GET /runs/{runId}

workspace_idstring required

Workspace that owns the training run

project_idstring required

Project that owns the training run

poll_urlstring uri required

URL for reading training progress and final charged cost

Example response

{
  "style_id": "sty_abc123",
  "run_id": "run_abc123",
  "workspace_id": "ws_abc123",
  "project_id": "prj_abc123"
}

Changes

    • warning

      added the new not_configured enum value to the / response property for the response status

    • warning

      added the new not_configured enum value to the / response property for the response status

    • warning

      added the new not_configured enum value to the / response property for the response status

    • warning

      added the new not_configured enum value to the / response property for the response status

    • warning

      added the new not_configured enum value to the / response property for the response status

    • warning

      added the new not_configured enum value to the / response property for the response status

    • warning

      added the new not_configured enum value to the / response property for the response status

    • warning

      added the new not_configured enum value to the / response property for the response status

    • warning

      added the new not_configured enum value to the / response property for the response status

    • info

      endpoint added