Omni-Image

POST /kling/v1/images/omni-image

MethodPOST
Path/kling/v1/images/omni-image
Typehttp
Status1
Module2102810
Folder74129731

概览

MethodPOST
Path/kling/v1/images/omni-image
Typehttp
Status1
Module2102810
Folder74129731

参数

{
  "header": [
    {
      "required": false,
      "description": "",
      "type": "string",
      "id": "Pu4ttDiQ1H",
      "enable": true,
      "name": "Content-Type",
      "sampleValue": "application/json"
    },
    {
      "required": false,
      "description": "",
      "type": "string",
      "id": "2On4gRB6tN",
      "enable": true,
      "name": "Authorization",
      "sampleValue": "Bearer {{YOUR_API_KEY}}"
    }
  ]
}

请求体

{
  "type": "application/json",
  "parameters": [],
  "jsonSchema": {
    "type": "object",
    "properties": {
      "model_name": {
        "type": "string",
        "description": "模型名称 枚举值:kling-image-o1,kling-v3-omni"
      },
      "prompt": {
        "type": "string",
        "description": "文本提示词,可包含正向描述和负向描述\n可将提示词模板化来满足不同的图像生成需求\n不能超过2500个字符"
      },
      "image_list": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "image": {
              "type": "string"
            }
          },
          "x-apifox-orders": [
            "image"
          ]
        },
        "description": "参考图列表"
      },
      "resolution": {
        "type": "string",
        "description": "生成图片的清晰度\n\n枚举值:1k, 2k\n1k:1K标清\n2k:2K高清"
      },
      "n": {
        "type": "integer",
        "description": "生成图片数量\n\n取值范围:[1,9]"
      },
      "result_type": {
        "type": "string",
        "description": "生成结果单图/组图切换开关\n枚举值:single,series"
      },
      "series_amount": {
        "type": "integer",
        "description": "生成组图的图片数量\n● 取值范围:[2, 9]\n当result_type值为single时,当前参数无效"
      },
      "aspect_ratio": {
        "type": "string",
        "description": "生成图片的画面纵横比(宽:高)\n枚举值:16:9, 9:16, 1:1, 4:3, 3:4, 3:2, 2:3, 21:9, auto\n其中:auto为根据传入内容智能生成视频\n参考原图横纵比生成新图时,当前参数无效"
      },
      "watermark_info": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "enabled"
        ],
        "x-apifox-orders": [
          "enabled"
        ],
        "description": "是否同时生成含水印的结果\n● 通过enabled参数定义,用key:value承载,如下::\n\"watermark_info\": {\n \t\"enabled\": boolean // true 为生成,false 为不生成\n}\n● 暂不支持自定义水印"
      },
      "callback_url": {
        "type": "string"
      },
      "external_task_id": {
        "type": "string"
      }
    },
    "required": [
      "model_name",
      "prompt"
    ],
    "x-apifox-orders": [
      "model_name",
      "prompt",
      "image_list",
      "resolution",
      "n",
      "result_type",
      "series_amount",
      "aspect_ratio",
      "watermark_info",
      "callback_url",
      "external_task_id"
    ]
  },
  "required": true,
  "mediaType": "",
  "examples": [
    {
      "mediaType": "application/json",
      "value": "{\r\n    \"model_name\": \"kling-image-o1\",\r\n    \"prompt\": \"生成一张海边跳舞的图片\",\r\n    // \"image_list\": [\r\n    //     {\r\n    //         \"image\": \"https://p2-fdl.klingai.com/ksc2/z3PF_5x5kcBzfxZU-uZ66pg5k_lhpifyoCyTFjn_jsKOiBYQGMoR7_kLKO34JyIdJbCSKR3vRneCwiyPHHjTPk01J7Dr65Ovoa7vYQuEh9c4j1_0G03JjIyKUMI58c29jou3zMmAyhzg7p8CrG7esV5agnr2P9XuO5VdTKdr0sUjEDycWEFe07ajsaYFg-wCu7vTJGLD0cr3nvYKnUl-CA.png?cacheKey=ChtzZWN1cml0eS5rbGluZy5tZXRhX2VuY3J5cHQSsAEeMBuZg7aCbU7N7Rcp5oJ-kfGAN3V073p1GMw7U9oTuISV4gRwnqW7X62AbPhPQVRmzngQDHsFrcGU8kCtzGOJEUWdikBNDmI_JPyD4jpae40CyqnscoIaQhbakFkkDSf515oxxHoFKX2uekXxhaC-Ux41JUupV2RFEPtWRqJtZy4w5ozqI6jbHeVXI7LP_zHpYOGuULmTPK93QFpw13NYPzMPddw3UIRVMrgRQxivnBoS0TR4h_eyjkvDOmDeFijUb3cSIiCmxVk1M5S1rqBZGCnxiZ3evpByg-3YWaVjVOSCzNW4rCgFMAE&x-kcdn-pid=112757&pkey=AAXAHqkraVdXL-kd_qQmLBUx0arOSG4SaHfdeXdQqN5MCBxYZ4QHE_nMRaT_7H8WHOAkbT65kOvXwPx8qkIAOsrbUM980pOy5e_FSqUqJgc_1oYe5msfxxfxRU6wi85LgDw\"\r\n    //     }\r\n    // ],\r\n    \"element_list\": [\r\n        {\r\n            \"element_id\": 835266081714884677\r\n        }\r\n    ],\r\n    \"resolution\": \"\",\r\n    \"n\": 1,\r\n    \"aspect_ratio\": \"\",\r\n    \"callback_url\": \"\",\r\n    \"external_task_id\": \"\"\r\n}"
    }
  ],
  "oasExtensions": ""
}

响应

[
  {
    "id": 119376443,
    "name": "成功",
    "code": 200,
    "contentType": "json",
    "jsonSchema": {
      "type": "object",
      "properties": {}
    },
    "itemSchema": {},
    "description": "",
    "mediaType": "",
    "headers": []
  }
]