Skip to content

Krea 2 Trainer

Integrate

Model id krea-2-trainer
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/krea-2-trainer?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "images_data_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

Files like the example: $0.30 300 API credits your files are measured before the run Run it on this page

Get API key
Krea Training #lora#personalization

Trains a custom Krea 2 LoRA from a zip of images, with optional auto-captioning

Krea · File

Your first result goes here

Build a request below and run it with your API key. Outputs are copied to our storage, kept forever or 7 days for free.

Build a request

Controls are generated from the model schema. The code and the price update as you change them.

resolution default 768

Training resolution, with 1024 favoring maximum fine detail and 768 offering approximately 1.7x faster training, reduced VRAM use, and nearly identical style quality. Images are scaled to cover the target square, then cropped at the center.

•required

URL for a training-image .zip containing PNG/JPG/JPEG/WebP files; a request fails with 422 if any image has neither a caption file nor a non-empty `trigger_phrase`. Captions are optional when `trigger_phrase` supplies the fallback, and otherwise use matching filename stems: ROOT.EXT pairs with ROOT.txt, for example 001.jpg with 001.txt.

default 100

Step count for LoRA training.

Advanced auto_captioning · trigger_phrase · learning_rate · debug_dataset
auto_captioning default Off

Optional captioning mode: Object/Character, Style, and Custom invoke dataset-captioner with google/gemma-4-31B-it, whereas Off keeps the existing requirement for each image to have a matching-stem .txt caption or use trigger_phrase as a fallback. For generated captions, trigger_phrase enters the captioning prompt and is normalized in the resulting sidecars according to the selected LoRA captioning convention.

default

DreamBooth-style instance phrase required if `auto_captioning` is Off and any image lacks a caption file. It supplies captions where .txt files are missing and provides the starting text for default validation prompts.

default 0.0005

LoRA B-factor learning rate, also applied to A if `lora_a_lr_multiplier=1`; under muon, it represents the AdamW-equivalent rate scaled by match_rms_adamw. For a constant schedule, Krea recommends the range 3e-4–7e-4.

POST /run/krea-2-trainer?wait=20 quote → $0.30
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/krea-2-trainer?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "images_data_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

Run this request

Your key stays in this browser: it is sent only to the Doitong API and saved (localStorage) only if you tick Remember. Get an API key

About Krea 2 Trainer

Fine-tunes a LoRA on a .zip of images at `images_data_url`, with optional same-name .txt captions and a `trigger_phrase`. `auto_captioning` modes are Off, Object/Character, Style and Custom. `steps` is 50 to 10000 (default 100), `resolution` is 768 or 1024. Outputs LoRA weights and a config file.

Parameters

NameType DefaultAllowed Description
images_data_urlrequired
Typestring
URL for a training-image .zip containing PNG/JPG/JPEG/WebP files; a request fails with 422 if any image has neither a caption file nor a non-empty `trigger_phrase`. Captions are optional when `trigger_phrase` supplies the fallback, and otherwise use matching filename stems: ROOT.EXT pairs with ROOT.txt, for example 001.jpg with 001.txt.
trigger_phraseoptional
Typestring
Default
DreamBooth-style instance phrase required if `auto_captioning` is Off and any image lacks a caption file. It supplies captions where .txt files are missing and provides the starting text for default validation prompts.
auto_captioningoptional
Typeenum
DefaultOff
OffObject/CharacterStyleCustom
Optional captioning mode: Object/Character, Style, and Custom invoke dataset-captioner with google/gemma-4-31B-it, whereas Off keeps the existing requirement for each image to have a matching-stem .txt caption or use trigger_phrase as a fallback. For generated captions, trigger_phrase enters the captioning prompt and is normalized in the resulting sidecars according to the selected LoRA captioning convention.
stepsoptional
Typeinteger
Default100
50 – 10,000
Step count for LoRA training.
learning_rateoptional
Typenumber
Default0.0005
0.000001 – 0.01
LoRA B-factor learning rate, also applied to A if `lora_a_lr_multiplier=1`; under muon, it represents the AdamW-equivalent rate scaled by match_rms_adamw. For a constant schedule, Krea recommends the range 3e-4–7e-4.
resolutionoptional
Typeenum
Default768
7681024
Training resolution, with 1024 favoring maximum fine detail and 768 offering approximately 1.7x faster training, reduced VRAM use, and nearly identical style quality. Images are scaled to cover the target square, then cropped at the center.
debug_datasetoptional
Typeboolean
Defaultfalse
Dataset-download option that exposes exactly what training used, packaged as an archive after caption backfill or automatic caption generation.
required

Output

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "krea-2-trainer",
  "status": "succeeded",
  "created_at": "2026-10-20T12:00:00Z",
  "started_at": "2026-10-20T12:00:02Z",
  "completed_at": "2026-10-20T12:00:09Z",
  "queue_position": null,
  "cost": {
    "credits": 300,
    "usd": "0.30",
    "charged": 300,
    "refunded": 0
  },
  "input": {
    "images_data_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
  },
  "output": {
    "lora_file": {
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_name": "0-output.jpeg",
      "file_size": 1843200
    },
    "config_file": {
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_name": "0-output.jpeg",
      "file_size": 1843200
    },
    "prompt_enhancement_system_prompt": "string",
    "debug_dataset": {
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_name": "0-output.jpeg",
      "file_size": 1843200
    }
  },
  "outputs": [
    {
      "type": "file",
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_size": 1843200,
      "stored": true
    }
  ],
  "error": null,
  "metrics": {
    "inference_seconds": 6.8
  },
  "urls": {
    "self": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
    "cancel": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
  }
}
Your files, your choiceEvery outputs[].url is a copy on our storage: kept forever (paid per GB-month) or 7 days for free, by your account setting or ?storage=.
Same shape on every modeltype, url, content_type, width, height and duration, for images, video and audio alike. output is the model’s own result object.
Fields of output
lora_file
object {url, content_type, file_name, file_size}Download URL for trained Krea-2 LoRA weights in safetensors format.
config_file
object {url, content_type, file_name, file_size}Link to a JSON file containing the training/LoRA configuration.
prompt_enhancement_system_prompt
string | nullSystem prompt returned with `auto_captioning` enabled to help write or refine inference prompts using the same caption convention as the automatically captioned training data.
debug_dataset
object {url, content_type, file_name, file_size} | nullTraining-data download provided when `debug_dataset` is enabled: an archive containing the prepared dataset and its automatically generated captions.

More models: Training

For AI agents: this page as Markdown is at https://doitong.com/developers/models/krea-2-trainer.md. All models and guides: https://doitong.com/developers/llms.txt