跳转到文档
打开控制台
本页内容

命名参考

参考标签绑定到您拥有的素材 ID。请查看所选模型的参考能力,并在报价和提交时保持相同的标签、顺序和配置。

参考绑定#

请将示例模型 ID、参考字段和能力版本替换为当前发现接口返回的值。参考支持因模型和工作流而异。

使用参考报价#

curl -X POST 'https://platform.tongai.io/v1/tools/tong_generation_quote/operations' \  -H "Authorization: Bearer $TONG_API_KEY" \  -H "Content-Type: application/json" \  -H "Idempotency-Key: 45be69f1-c266-4a09-a82c-bf3c6303eb03" \  -d '{  "input": {    "body": {      "operation": "IMAGE_EDIT",      "model": "MODEL_ID_FROM_DISCOVERY",      "inputAssetIds": [        "aaaaaaaaaaaaaaaaaaaaaaaa",        "bbbbbbbbbbbbbbbbbbbbbbbb"      ],      "referenceRequest": {        "prompt": "Keep the subject in @Image1 and use the setting in @Image2.",        "assetIds": [          "aaaaaaaaaaaaaaaaaaaaaaaa",          "bbbbbbbbbbbbbbbbbbbbbbbb"        ],        "direction": {          "version": 1,          "capabilityRevision": "REVISION_FROM_MODEL_CONFIGURATION",          "references": [            {              "id": "subject",              "assetId": "aaaaaaaaaaaaaaaaaaaaaaaa",              "field": "images",              "label": "Image1"            },            {              "id": "setting",              "assetId": "bbbbbbbbbbbbbbbbbbbbbbbb",              "field": "images",              "label": "Image2"            }          ]        }      }    }  }}'
配置
curl --version

使用参考提交#

curl -X POST 'https://platform.tongai.io/v1/tools/tong_generation_submit/operations' \  -H "Authorization: Bearer $TONG_API_KEY" \  -H "Content-Type: application/json" \  -H "Idempotency-Key: 45be69f1-c266-4a09-a82c-bf3c6303eb03" \  -d '{  "input": {    "params": {      "id": "cccccccccccccccccccccccc"    },    "body": {      "operation": "IMAGE_EDIT",      "quoteId": "QUOTE_SUBMIT_VALUE",      "prompt": "Keep the subject in @Image1 and use the setting in @Image2.",      "inputAssetIds": [        "aaaaaaaaaaaaaaaaaaaaaaaa",        "bbbbbbbbbbbbbbbbbbbbbbbb"      ],      "parameters": {        "imageModel": "MODEL_ID_FROM_DISCOVERY",        "referenceDirection": {          "version": 1,          "capabilityRevision": "REVISION_FROM_MODEL_CONFIGURATION",          "references": [            {              "id": "subject",              "assetId": "aaaaaaaaaaaaaaaaaaaaaaaa",              "field": "images",              "label": "Image1"            },            {              "id": "setting",              "assetId": "bbbbbbbbbbbbbbbbbbbbbbbb",              "field": "images",              "label": "Image2"            }          ]        }      }    }  }}'
配置
curl --version

Assistant 参考#

curl -X POST 'https://platform.tongai.io/v1/tools/tong_assistant_start/operations' \  -H "Authorization: Bearer $TONG_API_KEY" \  -H "Content-Type: application/json" \  -H "Idempotency-Key: 45be69f1-c266-4a09-a82c-bf3c6303eb03" \  -d '{  "input": {    "message": "Animate @Image1 and preserve the subject in @Image2.",    "attachments": [      "aaaaaaaaaaaaaaaaaaaaaaaa",      "bbbbbbbbbbbbbbbbbbbbbbbb"    ],    "reference_bindings": [      {        "label": "Image1",        "assetId": "aaaaaaaaaaaaaaaaaaaaaaaa"      },      {        "label": "Image2",        "assetId": "bbbbbbbbbbbbbbbbbbbbbbbb"      }    ],    "mode": "guided"  }}'
配置
curl --version