ApiframeApiframe Docs
AI Photos (LoRAs)

AI Photos (LoRAs)

Train a personal LoRA from a small set of subject photos, then generate AI photos of that subject from any text prompt.

The /v2/loras family lets you train and manage personal LoRAs — small fine-tunes that bake a specific subject (a person, a style, an object) into a reusable adapter you can run inference against in seconds.

Once a LoRA is READY, generate AI photos of that subject by hitting POST /v2/images/generate with model: "flux-lora" and the loraId you got back from training.

How it works

flowchart LR
  A["POST /v2/loras\n(15-30 photos + name)"] --> B[Caption + zip + upload]
  B --> C[Adapter training]
  C --> D[Status READY]
  D --> E["POST /v2/images/generate\nmodel: flux-lora\nloraId: ..."]
  1. Upload 15–30 subject photos (jpg / png / webp, ≤10 MB each, ≤100 MB total) to POST /v2/loras along with a name and (for person LoRAs) gender + ethnicity.
  2. The API auto-captions every image with a vision model, packages the dataset, and starts the training run. This takes ~15–25 minutes depending on the step count.
  3. The LoRA's status transitions through PENDING → UPLOADING → TRAINING → READY (or FAILED). Poll GET /v2/loras/:id or set a webhookUrl to be notified.
  4. Once READY, generate from the trained LoRA via POST /v2/images/generate — see flux-lora.

Trigger words

Every LoRA gets a unique 5-character trigger word generated server-side. The trigger word is returned on the LoRA object once status === READY so you can pre-fill it into your prompts and edit freely. The server de-duplicates: if your prompt already contains the trigger word it forwards as-is, otherwise it auto-prepends it. Either way, the trained subject shows up.

Concurrency limit

Each team can have at most team.maxConcurrentTrainings (default 10) LoRAs in PENDING | UPLOADING | TRAINING at the same time. Submissions over the cap return 429 Too Many Requests.

Pricing

StepCostNotes
Upload + caption + zip2 creditsCharged at POST /v2/loras time. Refunded on failure.
Training255 creditsCharged just before training starts. Refunded if training fails.
Inference (per image)2 creditsCharged per output image, 1–4 per request. See flux-lora.

Endpoints

Webhooks

Pass webhookUrl to POST /v2/loras to be notified when training reaches a terminal state. The payload is signed with your API key hash; see Webhooks for the verification recipe.

{
  "event": "completed",
  "id": "lora_8a4d…",
  "status": "READY",
  "imageCount": 18,
  "completedAt": "2026-04-25T10:42:11.000Z"
}

On this page