LoRA Trainer API: comparisons and examples

August 20, 2026 · View on GitHub

Train image-generation LoRA adapters through Muapi’s unified API. This repository is a practical reference for choosing a trainer, preparing a dataset, submitting a job, and polling the result. It contains documentation and copy-paste API examples rather than a separate client library.

Open the LoRA Trainer API landing page · Get an API key · API reference

What this repository covers

  • A comparison of the live Flux, FLUX.2 Klein, Qwen-Image, and Z-Image trainer endpoints.
  • Dataset preparation, trigger words, training-style selection, and common validation mistakes.
  • curl and Python examples for submitting a training job and polling /predictions/{id}/result.
  • Payload notes for dataset data URLs, training steps, learning rate, LoRA rank, and trigger words.

Trainer comparison

EndpointBase familyBest starting pointMain inputs
flux-lora-trainerFLUX.1 DevGeneral-purpose character or style adaptersimages_data_url, training_style, trigger_phrase
flux-1-dev-style-lora-trainerFLUX.1 DevStyle-focused trainingdataset, learning_rate, training_steps, trigger_word
flux-2-klein-4b-style-lora-trainerFLUX.2 Klein 4BA lighter style-training workflowdataset, learning_rate, training_steps, trigger_word
flux-2-klein-9b-style-lora-trainerFLUX.2 Klein 9BHigher-capacity FLUX.2 style trainingdataset, learning_rate, training_steps, trigger_word
qwen-image-lora-trainerQwen-ImageQwen image adaptersdata, learning_rate, lora_rank, steps, trigger_word
qwen-image-2512-lora-trainerQwen-Image 2512Qwen 2512-specific adaptersdata, learning_rate, lora_rank, steps, trigger_word
z-image-lora-trainerZ-ImageZ-Image adapter trainingdata, learning_rate, lora_rank, steps, trigger_word
z-image-base-lora-trainerZ-Image BaseBase-checkpoint Z-Image trainingdata, learning_rate, lora_rank, steps, trigger_word

Pricing and availability can change. Use the live Muapi page and the model response as the source of truth before launching a batch.

Quick start with curl

Create an API key at muapi.ai/access-keys, then prepare a dataset zip. The trainer accepts the dataset in the field documented for the selected endpoint; this example encodes the zip as a data URL for flux-lora-trainer.

export MUAPI_API_KEY="your_key"
export DATASET_DATA_URL="data:application/zip;base64,$(base64 < dataset.zip | tr -d '\n')"

curl -X POST "https://api.muapi.ai/api/v1/flux-lora-trainer" \
  -H "x-api-key: $MUAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d "$(python -c 'import json,os; print(json.dumps({"images_data_url":os.environ["DATASET_DATA_URL"],"training_style":"character","trigger_phrase":"TOK_CHARACTER"}))')"

The submission response contains a request identifier. Poll the result endpoint until its status is succeeded or completed:

export REQUEST_ID="id_from_the_submission_response"
curl "https://api.muapi.ai/api/v1/predictions/$REQUEST_ID/result" \
  -H "x-api-key: $MUAPI_API_KEY"

See examples/quickstart.py for a complete polling loop.

Dataset and payload guidance

  • Use a consistent subject or visual style and remove unrelated images before training.
  • Keep the trigger phrase unique; use the same phrase in later generation prompts.
  • Start with the trainer’s documented defaults, then change one training parameter at a time.
  • Store the returned adapter URL with the model, trigger phrase, dataset version, and training settings.
  • Treat uploaded images and generated adapters as sensitive creative assets; do not commit them or API keys.

Common failure modes

SymptomCheck
Request rejected before trainingDataset field, data-URL prefix, zip validity, and JSON escaping.
Adapter produces weak identity/styleCaption consistency, image variety, and trigger phrase usage.
Job appears stuckKeep polling the result endpoint; record the request ID and retry only after a terminal failure.
Output cannot be used laterPersist the result URL before temporary output storage expires.

License

The examples and documentation in this repository are released under the MIT License. The underlying models and generated assets remain subject to their own terms.