Skip to content

多图参考生图 ​

接口与可灵官网一致;支持多主体/场景/风格参考

  • 路径 POST /kling/v1/images/multi-image2image
  • 与官网一致:本页所有请求体、字段命名与返回结构与可灵官网保持一致
  • 字段详解:请参考官网权威文档

请求参数

参数类型必填说明
model_namestring否模型名称,仅支持 kling-v2、kling-v2-1
promptstring否正向文本提示词
subject_image_listarray是主体图片列表,1-4张
scene_imagestring否场景参考图
style_imagestring否风格参考图
nint否生成图片数量 [1,9],默认 1
aspect_ratiostring否纵横比:16:9、9:16、1:1、4:3、3:4、3:2、2:3、21:9
watermark_infoobject否是否生成含水印结果
callback_urlstring否回调通知地址
external_task_idstring否自定义任务ID

subject_image_list 格式

json
{
  "subject_image_list": [
    {"subject_image": "https://example.com/subject1.jpg"},
    {"subject_image": "https://example.com/subject2.jpg"}
  ]
}

补充约束

  • subject_image_list 必填,最多 4 张;
  • aspect_ratio 仅支持 16:9/9:16/1:1/4:3/3:4/3:2/2:3/21:9;
  • n 取值范围 [1, 9]。

场景:主体 + 场景 + 风格参考 ​

bash
curl --request POST \
  --url https://aiapi.fhddos.com/kling/v1/images/multi-image2image \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model_name": "kling-v2",
    "subject_image_list": [
      {"subject_image": "https://example.com/subject1.jpg"}
    ],
    "scene_image": "https://example.com/scene.jpg",
    "style_image": "https://example.com/style.jpg",
    "prompt": "Apply the artistic style to the scene composition",
    "n": 1,
    "aspect_ratio": "16:9"
  }'

示例响应

json
{
  "code": 0,
  "message": "success",
  "request_id": "req_1735558800_img456",
  "data": {
    "task_id": "task_01JGHQ...",
    "task_status": "submitted",
    "created_at": 1735558800000,
    "updated_at": 1735558800000
  }
}

OpenAPI ​

yaml
openapi: 3.0.3
info:
  title: Fhddos Core API
  version: '1.0'
  description: >-
    Core OpenAI-compatible and model-family endpoints used by the Fhddos user
    docs.
servers:
  - url: https://aiapi.fhddos.com
security:
  - BearerAuth: []
paths:
  /kling/v1/images/multi-image2image:
    post:
      tags:
        - Kling
      summary: Kling multi-image to image
      requestBody:
        $ref: '#/components/requestBodies/MultipartObject'
      responses:
        '200':
          $ref: '#/components/responses/JsonObject'
components:
  requestBodies:
    MultipartObject:
      required: true
      content:
        multipart/form-data:
          schema:
            $ref: '#/components/schemas/GenericObject'
  responses:
    JsonObject:
      description: OK
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GenericObject'
  schemas:
    GenericObject:
      type: object
      additionalProperties: true
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: 'Authorization: Bearer <token>'

Fhddos AI 用户文档