# MiniMax H3 Reference to Video LoRA Trainer API

> 이전 LoRA에서 웜 스타트를 지원하는 참조 조건부 비디오용 LoRA 트레이너

피사체 비디오 클립 zip 파일로 LoRA를 학습하여 참조 입력이 비디오 생성을 조정하도록 합니다. `reference_conditioning_p`는 학습 중 참조 사용 빈도를 설정하고 `resume_from_lora_url`은 이전에 학습한 LoRA에서 계속합니다. `rank`, `number_of_steps`, `number_of_frames`, `frame_rate` 및 `aspect_ratio`도 설정할 수 있습니다. 가중치와 config 파일을 반환합니다.

- Model id: `minimax/h3/ref2va/trainer`
- Made by: MiniMax
- Category: Training
- Output: file
- Price: $0.015 / step (cheapest run $30.00 (30000 API credits))
- Run: `POST https://api.doitong.com/v1/run/minimax/h3/ref2va/trainer`
- Quote: `POST https://api.doitong.com/v1/quote/minimax/h3/ref2va/trainer`
- Docs page: https://doitong.com/ko/developers/models/minimax/h3/ref2va/trainer

## Pricing

Price: **$0.015 / step**. Billed per training step (`number_of_steps`).

The full example input below costs $30.00 = 30000 API credits (2000 steps × 15 API credits).

Prices are the upstream price in USD, paid from the API balance in API credits (1000 API credits = 1 USD). `POST https://api.doitong.com/v1/quote/minimax/h3/ref2va/trainer` with the same JSON body returns the exact price for that input; the quote is exactly what a run charges. Invalid input is never charged and failed or canceled requests are refunded automatically.

## Input parameters

| Parameter | Canonical name | Type | Required | Default | Allowed values / range | Description |
|---|---|---|---|---|---|---|
| `training_data_url` |  | string | yes |  |  | 피사체 학습용 동영상 ZIP 파일의 URL입니다. 이미지만 포함된 데이터셋과 이미지/동영상이 혼합된 학습 아카이브는 허용되지 않으므로, 이미지는 별도의 참조 사이드카 파일로 제공해야 합니다. 선택적 추가 파일은 각 클립과 동일한 기본 이름을 사용합니다. 캡션은 `clip01.txt`와 같이 지정하고, `ref_1`부터 `ref_4`까지 순서가 지정된 참조는 `clip01.ref_1.<ext>`부터 `clip01.ref_4.<ext>`까지의 이름을 사용합니다. 참조 사이드카 파일이 없으면 클립의 프레임 하나를 자체 참조로 사용합니다. `<ext>`에 따라 참조 모달리티가 결정됩니다. 이미지(.png/.jpg/.jpeg), 오디오(.wav/.mp3/.flac/.m4a/.ogg/.aac), 동영상(.mp4/.mov/.avi/.mkv/.webm)을 지원하며, 동영상의 사운드트랙도 오디오 참조로 사용됩니다. 학습 클립은 .mp4, .mov, .avi, .mkv를 지원합니다. 최소 10개의 클립을 준비하는 것이 좋으며, 많을수록 좋습니다. |
| `rank` |  | enum (integer) | no | `32` | `8`, `16`, `32`, `64`, `128` | LoRA 적응 순위입니다. 값이 높아질수록 메모리 사용량이 증가하는 대신 용량이 커집니다. |
| `number_of_steps` |  | integer | no | `2000` | 1 – 15,000 | 전체 학습 단계 수입니다. |
| `learning_rate` |  | number | no | `0.0002` | 0.000001 – 1 | 최적화 학습률입니다. 값을 높일 때 발생할 수 있는 과적합 위험과 학습 속도 향상 가능성 사이의 균형을 조정합니다. |
| `number_of_frames` |  | integer | no | `73` | 22 – 124 | 각 학습 샘플의 프레임 수입니다. 17로 나눴을 때 나머지가 5여야 합니다. 예: 22, 39, 56, 73, 90, 107, 124. |
| `frame_rate` |  | integer | no | `24` | 8 – 60 | 초당 프레임으로 측정한 대상 동영상 프레임 속도입니다. |
| `resolution` |  | enum (string) | no | `medium` | `low`, `medium`, `high` | 학습 해상도입니다. 해상도를 높이면 메모리 요구량이 증가합니다. |
| `aspect_ratio` |  | enum (string) | no | `16:9` | `21:9`, `16:9`, `4:3`, `1:1`, `3:4`, `9:16` | MiniMax H3 API에서 사용할 수 있는 동일한 집합에서 학습 가로세로 비율을 선택합니다. |
| `trigger_phrase` |  | string | no | `` |  | 학습 중 캡션 시작 부분에 삽입하는 LoRA 스타일 활성화 문구입니다. |
| `reference_conditioning_p` |  | number | no | `0.9` | 0 – 1 | 학습 시 참조 이미지 조건부 학습과 비조건부 텍스트 기반 동영상·오디오 학습의 사용 비율을 설정합니다. 나머지 확률은 비조건부 학습 목표에 할당되어 프롬프트만으로도 안정적인 생성을 유지합니다. |
| `resume_from_lora_url` |  | string \| null | no |  |  | 이 트레이너로 이전에 생성한 .safetensors LoRA를 사용해 웜 스타트 학습을 수행하기 위한 URL입니다. 이후 number_of_steps만큼 추가 학습을 진행합니다. 어댑터 가중치만 복원되며, 최적화와 학습률 스케줄링은 모두 새로 시작됩니다. |
| `auto_scale_input` |  | boolean | no | `false` |  | 자동 동영상 스케일링으로 대상 fps와 프레임 수를 일치시킬지 여부입니다. true이면 이 조정이 활성화됩니다. |
| `split_input_into_scenes` |  | boolean | no | `true` |  | 길이 임계값보다 긴 동영상에 장면 분할을 활성화합니다. 분할된 클립의 참조 사이드카는 삭제됩니다. |
| `split_input_duration_threshold` |  | number | no | `30` | 1 – 60 | 초 단위의 길이로 표현하는 장면 분할 트리거입니다. 임계값보다 긴 동영상만 분할됩니다. |
| `debug_dataset` |  | boolean | no | `false` |  | 전체 학습을 시작하기 전에 전처리를 확인할 아카이브를 다운로드하는 옵션입니다. 활성화하면 트레이너가 처리된 데이터셋을 패키징하므로 캡션, 참조 이미지, 동영상 및 이미지가 올바른지 수동으로 검사할 수 있습니다. |
| `strict_dataset` |  | boolean | no | `false` |  | 그렇지 않으면 기록되고 문서화된 대체 방식으로 해결되는 전처리 문제를 엄격하게 처리합니다. 활성화하면 빈 프롬프트가 필요한 캡션, 누락된 참조 사이드카, 읽을 수 없는 오디오가 있는 동영상을 대체 방식으로 처리하지 않고 거부합니다. |

## Example input

Required parameters only:

```json
{
  "training_data_url": "https://example.com/your-file.zip"
}
```

A fuller example:

```json
{
  "training_data_url": "https://example.com/your-file.zip"
}
```

## Run it

Set `DOITONG_API_KEY` to a key from https://doitong.com/developers/dashboard#keys. `?wait=20` returns the finished request in the same call when it is ready within 20 seconds; otherwise poll `GET /requests/{id}` (it also accepts `?wait=`), or pass `webhook_url`.

### curl

```bash
# 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/minimax/h3/ref2va/trainer?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "training_data_url": "https://example.com/your-file.zip"
  }'

# 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"
```

### JavaScript

```javascript
const API = "https://api.doitong.com/v1";
const headers = {
  "Authorization": "Bearer " + process.env.DOITONG_API_KEY,
  "Content-Type": "application/json",
};

// Run the model; wait up to 20 s for the finished result in the same call
let res = await fetch(API + "/run/minimax/h3/ref2va/trainer?wait=20", {
  method: "POST",
  headers,
  body: JSON.stringify({
    "training_data_url": "https://example.com/your-file.zip"
  }),
});
let request = await res.json();
if (!res.ok) throw new Error(request.error.code + ": " + request.error.message);

// Not finished yet: long-poll until it is
while (request.status === "queued" || request.status === "running") {
  res = await fetch(API + "/requests/" + request.id + "?wait=20", { headers });
  request = await res.json();
}
if (request.status !== "succeeded") throw new Error(JSON.stringify(request.error));
console.log(request.outputs.map((o) => o.url), request.cost.credits + " API credits ($" + request.cost.usd + ")");
```

### Python

```python
import os
import requests

API = "https://api.doitong.com/v1"
headers = {"Authorization": "Bearer " + os.environ["DOITONG_API_KEY"]}

payload = {
    "training_data_url": "https://example.com/your-file.zip",
}

# Run the model; wait up to 20 s for the finished result in the same call
r = requests.post(API + "/run/minimax/h3/ref2va/trainer", params={"wait": 20}, json=payload, headers=headers)
request = r.json()
if not r.ok:
    raise RuntimeError(request["error"]["code"] + ": " + request["error"]["message"])

# Not finished yet: long-poll until it is
while request["status"] in ("queued", "running"):
    request = requests.get(API + "/requests/" + request["id"], params={"wait": 20}, headers=headers).json()
if request["status"] != "succeeded":
    raise RuntimeError(request["error"])
print([o["url"] for o in request["outputs"]], request["cost"]["credits"], "API credits", "$" + request["cost"]["usd"])
```

### MCP

The MCP server at `https://api.doitong.com/v1/mcp` exposes the tools `search_models`, `get_model`, `quote`, `run`, `get_request`, `cancel_request`, `list_requests`, `create_upload` and `get_account`. A `run` call for this model:

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "run",
    "arguments": {
      "model_id": "minimax/h3/ref2va/trainer",
      "input": {
        "training_data_url": "https://example.com/your-file.zip"
      },
      "wait_seconds": 20
    }
  }
}
```

## Response

Every call returns a request object. `status` is one of `queued`, `running`, `succeeded`, `failed`, `canceled`. `outputs` lists the generated files with URLs on our storage (kept forever, or 7 days with `?storage=temporary`; `storage` says which); `output` is the model's own result object with the same URLs.

```json
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "minimax/h3/ref2va/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": 30000,
    "usd": "30.00",
    "charged": 30000,
    "refunded": 0
  },
  "input": {
    "training_data_url": "https://example.com/your-file.zip"
  },
  "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
    },
    "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"
  }
}
```

### Output fields (`output`)

| Field | Type | Description |
|---|---|---|
| `lora_file` | object {url, content_type, file_name, file_size} | .safetensors 형식의 학습된 LoRA 가중치 URL입니다. |
| `config_file` | object {url, content_type, file_name, file_size} | 추론 엔드포인트 설정 구성입니다. |
| `debug_dataset` | object {url, content_type, file_name, file_size} \| null | `debug_dataset`이 활성화된 요청에서만 사용할 수 있는 다운로드 가능한 아카이브로, 전처리 후의 학습 데이터가 포함됩니다. |

## Related models

- [MiniMax H3 First Last Frame LoRA Trainer](https://doitong.com/developers/models/minimax/h3/flf2v/trainer.md) (`minimax/h3/flf2v/trainer`): $0.01 / step
- [MiniMax H3 Image to Video Audio LoRA Trainer](https://doitong.com/developers/models/minimax/h3/i2v/trainer.md) (`minimax/h3/i2v/trainer`): $0.01 / step
- [MiniMax H3 Text to Video LoRA Trainer](https://doitong.com/developers/models/minimax/h3/t2v/trainer.md) (`minimax/h3/t2v/trainer`): $0.005 / step
- [ERNIE-Image Trainer](https://doitong.com/developers/models/ernie-image-trainer.md) (`ernie-image-trainer`): $0.0012 / step
- [FLUX 2 \[klein\] 9b Base Trainer](https://doitong.com/developers/models/flux-2-klein-9b-base-trainer.md) (`flux-2-klein-9b-base-trainer`): $0.0043 / step
- [Flux 2 Klein 9B Base Trainer](https://doitong.com/developers/models/flux-2-klein-9b-base-trainer/edit.md) (`flux-2-klein-9b-base-trainer/edit`): $0.0139 / step
- [FLUX 2 Trainer](https://doitong.com/developers/models/flux-2-trainer.md) (`flux-2-trainer`): $0.0064 / step
- [FLUX 2 Trainer Edit](https://doitong.com/developers/models/flux-2-trainer/edit.md) (`flux-2-trainer/edit`): $0.0389 / step

## Links

- HTML page: https://doitong.com/developers/models/minimax/h3/ref2va/trainer
- All models and guides for AI agents: https://doitong.com/developers/llms.txt
- OpenAPI 3.1 with this model's typed request body: https://doitong.com/developers/openapi.json?model=minimax/h3/ref2va/trainer
- Errors: https://doitong.com/developers/docs/errors
- Model details as JSON: https://api.doitong.com/v1/models/minimax/h3/ref2va/trainer
