Skip to content
Get started

Replace Pairs

models.training_images.replace_pairs(strmodel_id, TrainingImageReplacePairsParams**kwargs) -> TrainingImageReplacePairsResponse
PUT/models/{modelId}/training-images/pairs

Replace all training image pairs for the given modelId (at most 50). Edit models pair a sourceId with a targetId. MiniMax H3 Ref (minimax-h3-ref-lora) pairs are its dataset: a video targetId (5.25 to 30 seconds), its caption in instruction (or the video description) and 1 to 12 referenceIds (at most 9 images, 3 videos of 2 to 15 seconds and 3 audio files, at least one image or video, none of them the target or repeated); each video target may appear in only one pair. Training needs at least 5 pairs and checks the target durations and the 400 MB cap on every file when it starts.

ParametersExpand Collapse
model_id: str
body: Iterable[Body]

Array of training image pairs

instruction: Optional[str]

The instruction for the pair, source to target. For MiniMax H3 Ref training, this is the caption of the video target.

reference_ids: Optional[Sequence[str]]

MiniMax H3 Ref training only: the training assets conditioning the video target (targetId), in the order the model reads them. At most 12 per entry, of which at most 9 images, 3 videos (2 to 15 seconds each) and 3 audio files, with at least one image or video. sourceId is not used.

source_id: Optional[str]

The source asset ID (must be a training asset)

target_id: Optional[str]

The target asset ID (must be a training asset)

project_id: Optional[str]

The projectId used for ownership resource management. Either to assert ownership or to set the owner of the resource(s)

ReturnsExpand Collapse
class TrainingImageReplacePairsResponse: …
count: float

Number of training image pairs

pairs: List[Pair]

Array of training image pairs

instruction: Optional[str]

The instruction for the pair, source to target. For MiniMax H3 Ref training, this is the caption of the video target.

reference_ids: Optional[List[str]]

MiniMax H3 Ref training only: the training assets conditioning the video target (targetId), in the order the model reads them. At most 12 per entry, of which at most 9 images, 3 videos (2 to 15 seconds each) and 3 audio files, with at least one image or video. sourceId is not used.

source_id: Optional[str]

The source asset ID (must be a training asset)

target_id: Optional[str]

The target asset ID (must be a training asset)

Replace Pairs

import os
from scenario_sdk import Scenario

client = Scenario(
    api_key=os.environ.get("SCENARIO_SDK_API_KEY"),  # This is the default and can be omitted
    api_secret=os.environ.get("SCENARIO_SDK_API_SECRET"),  # This is the default and can be omitted
)
response = client.models.training_images.replace_pairs(
    model_id="modelId",
    body=[{}],
)
print(response.count)
{
  "count": 0,
  "pairs": [
    {
      "instruction": "instruction",
      "referenceIds": [
        "string"
      ],
      "sourceId": "sourceId",
      "targetId": "targetId"
    }
  ]
}
Returns Examples
{
  "count": 0,
  "pairs": [
    {
      "instruction": "instruction",
      "referenceIds": [
        "string"
      ],
      "sourceId": "sourceId",
      "targetId": "targetId"
    }
  ]
}