Skip to content
Get started

Replace Pairs

client.models.trainingImages.replacePairs(stringmodelID, TrainingImageReplacePairsParams { body } params, RequestOptionsoptions?): TrainingImageReplacePairsResponse { count, pairs }
PUT/models/{modelId}/training-images/pairs

Replace all training image pairs for the given modelId

ParametersExpand Collapse
modelID: string
params: TrainingImageReplacePairsParams { body }
body: Array<Body>

Array of training image pairs

instruction?: string

The instruction for the image pair, source to target

sourceId?: string

The source asset ID (must be a training asset)

targetId?: string

The target asset ID (must be a training asset)

ReturnsExpand Collapse
TrainingImageReplacePairsResponse { count, pairs }
count: number

Number of training image pairs

pairs: Array<Pair>

Array of training image pairs

instruction?: string

The instruction for the image pair, source to target

sourceId?: string

The source asset ID (must be a training asset)

targetId?: string

The target asset ID (must be a training asset)

Replace Pairs

import Scenario from '@scenario-labs/sdk';

const client = new Scenario({
  apiKey: process.env['SCENARIO_SDK_API_KEY'], // This is the default and can be omitted
  apiSecret: process.env['SCENARIO_SDK_API_SECRET'], // This is the default and can be omitted
});

const response = await client.models.trainingImages.replacePairs('modelId', { body: [{}] });

console.log(response.count);
{
  "count": 0,
  "pairs": [
    {
      "instruction": "instruction",
      "sourceId": "sourceId",
      "targetId": "targetId"
    }
  ]
}
Returns Examples
{
  "count": 0,
  "pairs": [
    {
      "instruction": "instruction",
      "sourceId": "sourceId",
      "targetId": "targetId"
    }
  ]
}